I am about to graduate with my Associates degree in Math and will soon go for my bachelors. I've decided with two years of school left its best if I start learning to program. I am starting with python.
I recently completed a beginners course on YouTube from free code camp. I completed novice programs that come with the course. (Guessing game)(mad Libs) & a(multiple choice quiz)
Now I am moving on to complete 3 programs outside of the lecture before I move to another python course. My ideas were (Dice game), (Hangman), (short game)
Below is my python code for the dice game. I planned on creating an array and looping through then selecting a random number from the loop. It's proving a little difficult. so far I just print a 3x3 matrix then select a random number. fyi the 3x3 is suppose to represent a 9 sided dice.
My question: Is this code good enough for me to move on to my next program or should I stick with it and code the dice game the way I originally planned. Thank you for the feedback.
#Create dice using matrix 9 sides
#Create function: Give user option to roll dice
#Return random dice number 1-9
from random import seed
from random import randint
dice = [
[[1],[2],[3]],
[[4],[5],[6]],
[[7],[8],[9]]
]
def diceroll():
start = input("do you want to play dice Y/N ")
if start == "Y" or start == "y":
print(dice[0])
print(dice[1])
print(dice[2])
x = input("Do you want to roll the dice: Y/N ")
while x == "y" or x =="Y":
if x != "y" or x !="Y":
for i in range(1):
roll=randint(1,9)
print(roll)
x = input("Do you want to roll the dice again: Y/N ")
else:
print("GoodBye: ")
while
loop and theif
-statement inside of it are incompatible; only one can be true). \$\endgroup\$