“simulator rolling dadu python” Kode Jawaban

simulator dadu di python

import speech_recognition as sr
import pyttsx3
import random

engine = pyttsx3.init('sapi5')
voices = engine.getProperty('voices')
# print(voices[1].id)
engine.setProperty('voice', voices[0].id)


def speak(audio):
    engine.say(audio)
    engine.runAndWait()

no = random.randint(1,6)
print(no)

if no == 1:
        print("[-----]")
        print("[     ]")
        print("[  0  ]")
        print("[     ]")
        print("[-----]")
if no == 2:
        print("[-----]")
        print("[ 0   ]")
        print("[     ]")
        print("[   0 ]")
        print("[-----]")
if no == 3:
        print("[-----]")
        print("[     ]")
        print("[0 0 0]")
        print("[     ]")
        print("[-----]")
if no == 4:
        print("[-----]")
        print("[0   0]")
        print("[     ]")
        print("[0   0]")
        print("[-----]")
if no == 5:
        print("[-----]")
        print("[0   0]")
        print("[  0  ]")
        print("[0   0]")
        print("[-----]")
if no == 6:
        print("[-----]")
        print("[0 0 0]")
        print("[     ]")
        print("[0 0 0]")
        print("[-----]")
          
speak(f"your number is: {no}")
Coding boy Hasya

simulator rolling dadu python

from random import randint

def roll_dice():
    print(f"Number is: {randint(1,6)}")

# Do this to simulate once
roll_dice()   

# Do this to simulate multiple times
whatever = 12 # Put the number of times you want to simulate here
for number in range(whatever):
    roll_dice()
Random boi

simulator rolling dadu python

101computing.net/double-six-dice-game
William McMellon

Jawaban yang mirip dengan “simulator rolling dadu python”

Pertanyaan yang mirip dengan “simulator rolling dadu python”

Lebih banyak jawaban terkait untuk “simulator rolling dadu python” di Python

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya