koulin

pps dz 2

Jun 28th, 2023
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.04 KB | Jokes | 0 0
  1. # задача 2
  2. password = input()
  3. password_correct = input()
  4. if password == password_correct:
  5.     print('True')
  6. else:
  7.     print('False')
  8. # задача 3
  9. a = []
  10. n = int(input())
  11. for i in range(n):
  12.     a.append(int(input()))
  13. print(min(a))
  14. # задача 4
  15. a = []
  16. n = int(input())
  17. for i in range(n):
  18.     a.append(int(input()))
  19. print(max(a))
  20. # задача 5
  21. a, b, c = (int(input()) for i in range(3))
  22. if a + b > c and a + c > b and b + c > a:
  23.     print('True')
  24. else:
  25.     print('False')
  26. #задача 6
  27. a, b, c = (int(input()) for i in range(3))
  28. if a + b > c and a + c > b and b + c > a:
  29.     if a == b == c:
  30.         print('Равносторонний')
  31.     elif a == b or b == c or c == a:
  32.         print('Равнобердренный')
  33.     else:
  34.         print('Разностороний')
  35. else:
  36.     print('Вырожденный')
  37. #задача 7
  38. def otrezki(a,b,c,d):
  39.     k = 0
  40.     for x in range(0,max(a,b,c,d)+1):
  41.         if a <= x <= b and c <= x <= d:
  42.             k += 1
  43.     return k
  44. print(otrezki(3,13,7,17))
  45.  
Advertisement
Add Comment
Please, Sign In to add comment