Advertisement
Guest User

Untitled

a guest
Dec 9th, 2019
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.57 KB | None | 0 0
  1. import random as r
  2. s=0
  3. k=0
  4. while k<=12:
  5. a=r.randrange(100)
  6. s+=a
  7. k+=1
  8. print('периметр:',s)
  9.  
  10. s=0
  11. k=0
  12. while k<=10:
  13. a=r.randrange(100)
  14. if (a%10)==0:
  15. s+=a
  16. k+=1
  17. print('сумма:',s)
  18.  
  19. s=0
  20. k=0
  21. while k<=12:
  22. a=r.randint(140,200)
  23. if a<165:
  24. a=1
  25. s+=a
  26. k+=1
  27. print('кол-во чел ниже 165:',s)
  28.  
  29. s=0
  30. k=0
  31. while k<=30:
  32. a=r.randint(1,5)
  33. if a==5:
  34. a=1
  35. s+=a
  36. k+=1
  37. print('кол-во 5:',s)
  38.  
  39. s=0
  40. k=0
  41. while k<=30:
  42. a=r.randrange(1000)
  43. if (k%2)==0:
  44. s+=a
  45. k+=1
  46. print('кол-во осадков:',s,'мм')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement