Nondecreasing digits X16536


Statement
 

pdf   zip   main.py

html

Write a function nondec(n) that receives an integer n>0 and reports whether its digits (in base 10) form a nondecreasing sequence (that is, each digit is greater or equal to the previous one).

Sample session
>>> nondec(113355779)
True
>>> nondec(44569)
True
>>> nondec(346234)
False
>>> nondec(222)
True
Information
Author
ProAl1
Language
English
Official solutions
Python
User solutions
Python