Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
1.1 kB
0
Indexable
Never
# Import the random module
import random

# Define a list of possible answers in Somali
answers = ["Haa", "Maya", "Waa hubaal", "Waxaan kaaga baryayaa", "Waa inaad iswaydiiso markale", "Waxaan kaaga baryayaa", "Waxaan kaaga baryayaa", "Waxaan kaaga baryayaa", "Waxaan kaaga baryayaa", "Waxaan kaaga baryayaa", "Waxaan kaaga baryayaa", "Waxaan kaaga baryayaa", "Waxaan kaaga baryayaa", "Waxaan kaaga baryayaa", "Waxaan kaaga baryayaa", "Waxaan kaaga baryayaa", "Waxaan kaaga baryayaa", "Waxaan kaaga baryayaa", "Waxaan kaaga baryayaa"]

# Define a function to play the game
def magic_8_ball():
  # Ask the user to enter a question
  question = input("Fadlan weydii su'aal: ")
  # Check if the user entered a question
  if question:
    # Generate a random index from 0 to 19
    index = random.randint(0, 19)
    # Select the answer corresponding to the index
    answer = answers[index]
    # Print the answer
    print("Jawaabtaada waa: " + answer)
  else:
    # Print a message to enter a question
    print("Fadlan gali su'aal.")

# Call the function to play the game
magic_8_ball()