Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2019
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.73 KB | None | 0 0
  1. print("Введите число")
  2. n = int(input())
  3. a = 0
  4. b = -1
  5. for i in range(n):
  6.     b += 2
  7.     a += b
  8. print(a)
  9.    
  10.  
  11.  
  12. a = 179
  13. b = 2007
  14. c = 1543
  15. d = 179+2007*1543
  16. print(d)
  17.  
  18.  
  19. print("Введите 1е число ")
  20. a = int(input())
  21. c = 0
  22. for i in range(9):
  23.     b = int(input("Введите следующее число "))
  24.     if (a > 0 and b < 0) or (a < 0 and b > 0):
  25.         c += 1
  26.    
  27.    
  28. print(c)  
  29.  
  30.  
  31. print("Введите число: ")
  32. n = int(input())
  33. a = 0
  34. for i in range(n):
  35.     if i**2 < n:
  36.         a = i**2
  37.         print(a)
  38.    
  39.  
  40.  
  41.  
  42. print("Введите число: ")
  43. n = int(input())
  44. a = 0
  45. s = 0
  46. for i in range(6):
  47.     s += a
  48.     a = n % 10
  49.     n = n// 10
  50. print(s)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement