Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions Dice-Simulator/dice.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,23 @@ def roll_dice():
print("| |")
print("| 0 0 0 |")
print("-----------")
return number


print(" Dics Simulator ")
print(" Dice Simulator ")
score=0
x = 'y'
while x.lower() == "y":
roll_dice() # function call

rolled_number=roll_dice() #function called
score+=rolled_number
print("Your Score: ",score)
choice = input("Do you want to play again (y/n): ") # choice from user

if choice.lower() == "n":
print('Your final score: ',score)
exit(0)




elif choice.lower()=='y':
continue
else:
print("Invalid Input! Exiting program.")
exit(0)