Advertisement
Guest User

march29.py

a guest
Mar 29th, 2020
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. from random import randrange
  2. choices = ["rock", "paper", "egg"]
  3.  
  4. choice = choices[randrange(0, len(choices))]
  5. choice2 = choices[randrange(0, len(choices))]
  6.  
  7. print(choice)
  8.  
  9. #if elif else
  10. #if "else if" else
  11. attributes = ["SYRIAN"]
  12. attributes2 = ["SYRIAN", "PERSIAN"]
  13.  
  14. if "SYRIAN" in attributes2:
  15. pass
  16.  
  17. if "PERSIAN" in attributes2:
  18. pass
  19.  
  20. plan = "A"
  21.  
  22. # if plan == "A":
  23. # plana()
  24. # elif plan == "B":
  25. # planb()
  26. # elif plan == 'C':
  27. # planc()
  28.  
  29. def calculate_average():
  30. name = input("Hello please enter your name: ")
  31. marks = [float(x) for x in input("Please enter your marks separated by commas(,): ").split(",")]
  32. secret_average = 0
  33.  
  34. if (name == "ali"):
  35. secret_average = 100
  36.  
  37. average = sum(marks)/len(marks) + secret_average
  38. print(f"Okay {name}, your average of all {len(marks)} of your marks is: {average}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement