mardi 22 décembre 2020

dice rolling game: odd sum gets a malus, even sum a bonus

I have to make a dice game. Down below is my code so far for the actual dice rolling section.

If the total number from the dices are even, 10 points must be added on. However if the total is an odd number, 5 points must be taken away.

  import random

  print("player 1, please roll dice")
  rolldice=input("would you like to roll dice?")
  if rolldice=="yes":
     roll1 = random.randint(1,6)

  roll2=random.randint(1,6)

  print("You rolled",roll1)
  print("you rolled",roll2)
  if roll1+roll2="2,4,6,8,10,12":
      print("roll1+roll2+10"):

Aucun commentaire:

Enregistrer un commentaire