Advertisement
Radoslav_03

1 zad

Sep 6th, 2023
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.48 KB | None | 0 0
  1. n = int(input())
  2.  
  3. list1 = []
  4. list2 = []
  5.  
  6. while n != 0:
  7.     if n % 3 == 0 and n % 2 == 0:
  8.         list1.append(n)
  9.     elif n % 7 == 0 and n % 2 != 0:
  10.         list2.append(n)
  11.  
  12.     n = int(input())
  13.  
  14. odd_index_sum = 0
  15. for index, digit in enumerate(list1):
  16.     if index % 2 != 0:
  17.         odd_index_sum += digit
  18.    
  19. list2.sort(reverse=True)
  20.  
  21. min_num = min(list2)
  22. max_num = max(list2)
  23.  
  24. prod = max_num * min_num
  25.  
  26. print(list1)
  27. print(list2)
  28. print(odd_index_sum)
  29. print(prod)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement