mardi 14 mai 2019

From random import choice issue with Pycharm

I get issues when trying to run the - from random import choice

I am trying to get generate random questions when running the code. It simply does not run the code inside Pycharm, but works fine inside idle3.

from random import choice

questions = ["Why is the sky blue?: ", "Why is there a face on the moon?: ", "Where are all the dinosaurs: "]

question = choice(questions) answer = input(question).strip().lower()

while answer != "just because": answer = input("why?: ").strip().lower()

print("Oh... Okay")

My aim is to generate random questions when answered correctly.




Aucun commentaire:

Enregistrer un commentaire