Advertisement
nikol_bratkova

Untitled

Apr 26th, 2022
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. # ____________________________________________________________________
  2.  
  3.  
  4. # reads how many numbers does the sequence have
  5. n = int(input())
  6.  
  7. # for loop through n numbers
  8. for i in range(1, n + 1):
  9. number = input() # reads the numbers in the sequence
  10.  
  11. if i == 1: # there isnt comparison for first number
  12. output = str(number) # creates output string
  13. else:
  14. if previous > number:
  15. output = output + f'>{number}'
  16. elif previous < number:
  17. output = output + f'<{number}'
  18. else:
  19. output = output + f'={number}'
  20.  
  21. previous = number # stores the number for the next comparison
  22.  
  23. print(output)
  24.  
  25. # ____________________________________________________________________
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement