Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def reshima():
- list = []
- str1 = raw_input("Enter list of strings with spaces between words: ")
- list = str1.split()
- print 'Your input:', list
- bool1 = input('Enter either True or False for Reversed sort: ')
- sort1 = sorted(list)
- if bool1 == True:
- print 'Your new input:', sort1
- else:
- sort1 = sorted(sort1, reverse=True) # sorted(iterable, key=None, reverse=False)
- # variable equal to sorted(variable, and what i want to change in it)
- print 'Your new input:', sort1
- reshima()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement