r/pythonhelp • • Apr 18 '24

Need hel[ with coding robot barista

Hello!

I'm new to python and i was coding a robot barista, but every time i awnser "good" it just closes.

Is anyone willing to help me with this problem?

Thank you!

P.S. English is not my first language and i had to translate my code so sorry if the talking in the code sounds a bit weird.

This is my python script:

#Robot barista:

import time

input()

print ("\n")

print("Hello, Welkom to Bob's coffee!")

time.sleep(2)

print("What's your name?")

name = input()

time.sleep(1)

print ("\nHello " + name + "!")

time.sleep(1)

mood = input("How are you doing?\n")

if mood =="good":

print("Oh, that's good to hear!\n")

time.sleep(1)

if mood =="Good":

print("Oh, that's good to hear!\n")

time.sleep(1)

if mood =="Good!":

print("Oh, that's good to hear!\n")

time.sleep(1)

if mood =="good!":

print("Oh, that's good to hear!\n")

time.sleep(1)

if mood == "bad":

print("Oh, that's not nice to hear")

input ("Why are you doing bad?\n")

print("Hmm... I hope you will be ok soon!\n")

time.sleep(1)

a = input("Would you like something to Eat/Drink?\n")

time.sleep(2)

if mood == "Bad":

print("Oh, that's not nice to hear")

input ("Why are you doing bad?\n")

print("Hmm... I hope you will be ok soon!\n")

time.sleep(1)

a = input("Would you like something to Eat/Drink?\n")

time.sleep(2)

if mood == "Bad!":

print("Oh, that's not nice to hear")

input ("Why are you doing bad?\n")

print("Hmm... I hope you will be ok soon!\n")

time.sleep(1)

a = input("Would you like something to Eat/Drink?\n")

time.sleep(2)

if mood == "bad!":

print("Oh, that's not nice to hear")

input ("Why are you doing bad?\n")

print("Hmm... I hope you will be ok soon!\n")

time.sleep(1)

a = input("Would you like something to Eat/Drink?\n")

time.sleep(2)

if a == "No":

print("Ok\nBye!")

time.sleep(1)

quit()

if a == "Yes":

print(" \n" * 100)

print("This is the menu:\n Latte, Black Cofee, Ice Cofee and Appele Cake")

time.sleep(1)

print("What would you like to order?")

input()

2 Upvotes

4 comments sorted by

View all comments

Show parent comment

1

u/cornhub43 Apr 20 '24

Ok, i've pasted the code to pastebin: https://pastebin.com/FcpfipXE

1

u/CraigAT Apr 21 '24

As long as it prints "that's good to hear" then it's doing what I would expect it to.

What are you expecting to happen?