Slmaan

Untitled

Mar 30th, 2021
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. #List of cars entering the parking every hour
  2. #count :To calculate total hours
  3. #sum : total cars
  4. #The Parkinage holds 200 cars.
  5. print ("\t \t hey Client \n Enter the number of cars per hour. into the parking")
  6. list=[]
  7. count=0
  8. sum=0
  9. day=1
  10. hourse=1
  11.  
  12. print ("day",day)
  13. while True:
  14. try:
  15. print("HOURSE", hourse)
  16. x=int(input())
  17. except :
  18. print("value error","pleas try again")
  19. continue
  20. if x >200 :
  21. print("The parking can't hold.")
  22. x= 200
  23. if x <0 :
  24. break
  25.  
  26. list.append(x)
  27. count += 1
  28. sum += x
  29. hourse +=1
  30. if hourse == 25:
  31. hourse -=24
  32. day += 1
  33. print("the all list for day" , list)
  34. print("##### \n day",day)
  35. print ("all list " , list)
  36. print("the maximum numper =",max(list))
  37. print(" the minemum numper =",min(list))
  38. print(" sum of all cars = ",sum)
  39. avarge =sum/count
  40. print("avarge is = ",avarge )
  41. print("count is =",count)
  42. print("the all list ",(list))
  43. f = float(input("Enter a number to see what hour the event was"))
  44. print (list.index(f)+1)
Advertisement
Add Comment
Please, Sign In to add comment