When I run my code there is a sort of indent at "Q:" but not "A:". Do you know why that is? It does not stop the code from running, it works, but it would look neater to me if they "Q:" and "A:" were both in line. Thanks.
CODE:
jokes = ["Q: What do you call a boomerang that won't come back?\n\nA: A stick\n","Q: What's the difference between ‘Oooh’ and ‘Aaah’?\n\nA: About 3 inches\n","Q: Why do most women pay more attention to their appearance than improving their minds?\n\nA: Because most men are stupid but few are blind\n","Q: How do you tell a male chromosome from a female chromosome?\n\nA: Pull down its genes","Q: What do you call a fake spaghetti?\n\nA: An im-pasta\n","Q: What did the yoga instructor say to her landlord when he tried to evict her?\n\nA: Namaste\n","Q: What do you call a row of rabbits jumping backwards?\n\nA: A receding hare line\n","Q: What do you call a boomerang that won't come back?\n\nA: A stick\n","Q: What did one wall say to the other wall?\n\nA: I’ll meet you at the corner\n", "Q: What do you call a bear with no teeth?\n\nA: A gummy bear\n"]
----
FULL CODE:
import time
import string
import random
def newjoke(joke):
time.sleep(1)
print ("\nWell what about this:\n\n",joke)
time.sleep(0.5)
jokes = ["Q: What do you call a boomerang that won't come back?\n\nA: A stick\n","Q: What's the difference between ‘Oooh’ and ‘Aaah’?\n\nA: About 3 inches\n","Q: Why do most women pay more attention to their appearance than improving their minds?\n\nA: Because most men are stupid but few are blind\n","Q: How do you tell a male chromosome from a female chromosome?\n\nA: Pull down its genes","Q: What do you call a fake spaghetti?\n\nA: An im-pasta\n","Q: What did the yoga instructor say to her landlord when he tried to evict her?\n\nA: Namaste\n","Q: What do you call a row of rabbits jumping backwards?\n\nA: A receding hare line\n","Q: What do you call a boomerang that won't come back?\n\nA: A stick\n","Q: What did one wall say to the other wall?\n\nA: I’ll meet you at the corner\n", "Q: What do you call a bear with no teeth?\n\nA: A gummy bear\n"]
print ("Welcome to the Joke game")
time.sleep(1)
print ("You will be told a joke and it's answer")
time.sleep(1)
print ("Then you have to put in if you found it funny or not - yes/no\n")
time.sleep(1.5)
print ("Q: What's the point in pushing an envelope?\n\nA: There's no point because it's always going to be stationary!\n")
while True:
time.sleep(3)
funny = input("\nDid you find that funny?\n").lower()
if funny == "no":
joke = random.choice(jokes)
funny = newjoke(joke)
if funny == "yes":
time.sleep(0.5)
print ("\nI know, I'm a comedian")
break
----
THE INDENT (WHEN RAN):
Well what about this:
Q: What do you call a boomerang that won't come back?
A: A stick
What I have tried:
I have tried re-typing the
\n
but still won't work. I'd appreciate it if you could help me out. Thanks.