Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # ____________________________________________________________________
- # reads how many numbers does the sequence have
- n = int(input())
- # for loop through n numbers
- for i in range(1, n + 1):
- number = input() # reads the numbers in the sequence
- if i == 1: # there isnt comparison for first number
- output = str(number) # creates output string
- else:
- if previous > number:
- output = output + f'>{number}'
- elif previous < number:
- output = output + f'<{number}'
- else:
- output = output + f'={number}'
- previous = number # stores the number for the next comparison
- print(output)
- # ____________________________________________________________________
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement