“8 Daftar Respons Bola Python” Kode Jawaban

8 Daftar Respons Bola Python

responses = ["As I see it, yes.", "Ask again later.", "Better not tell you now.", "Cannot predict now.", "Concentrate and ask again.",
             "Don’t count on it.", "It is certain.", "It is decidedly so.", "Most likely.", "My reply is no.", "My sources say no.",
             "Outlook not so good.", "Outlook good.", "Reply hazy, try again.", "Signs point to yes.", "Very doubtful.", "Without a doubt.",
             "Yes.", "Yes – definitely.", "You may rely on it."]
Ava

8 Daftar Respons Bola Python


import sys
import random

ans = True

while ans:
    question = input("Ask the magic 8 ball a question: (press enter to quit) ")

    answers = random.randint(1,8)

    if question == "":
        sys.exit()

elif answers == 1:
    print ("It is certain")

    elif answers == 2:
        print ("Outlook good")

    elif answers == 3:
        print ("You may rely on it")

    elif answers == 4:
        print ("Ask again later")

    elif answers == 5:
        print ("Concentrate and ask again")

    elif answers == 6:
        print ("Reply hazy, try again")

    elif answers == 7:
        print ("My reply is no")

    elif answers == 8:
        print ("My sources say no")
    ans = False

Breakable Barracuda

Jawaban yang mirip dengan “8 Daftar Respons Bola Python”

Pertanyaan yang mirip dengan “8 Daftar Respons Bola Python”

Lebih banyak jawaban terkait untuk “8 Daftar Respons Bola Python” di Python

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya