Clear Doubts with Computer TutorIn case you’re facing problems in understanding concepts, writing programs, solving questions, want to learn fun facts | tips | tricks or absolutely anything around computer science, feel free to join CTs learner-teacher community: students.computertutor.in
import random def rolladice(): counter = 0 myList = [] while (counter) < 6: randomNumber = random.randint(1,6) myList.append(randomNumber) counter = counter + 1 if (counter)>=6: pass else: return myList # Take user input here n=1 while(n==1): n = int(input("Enter 1 to roll a dice and get a random number:")) print(rolladice())
You cannot copy content of this page