def is_sorted(t):
if t == sorted(t):
return True
else:
return False
print is_sorted([1,2,2]) # True
print is_sorted(['b','a']) # False
print is_sorted([3, 1, 5, 2, 4]) # False
print is_sorted(['d', 'a', 'c', 'b']) # False
print is_sorted(['a', 'b', 'b', 'd', 'e', 'e', 'f', 'g']) # True
jeremywduncan -1 Newbie Poster
vegaseat 1,735 DaniWeb's Hypocrite Team Colleague
jeremywduncan -1 Newbie Poster
woooee 814 Nearly a Posting Maven
Ene Uran 638 Posting Virtuoso
jeremywduncan -1 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.