#πŸ”’ closing code

14 messages Β· Page 1 of 1 (latest)

paper plank
#

im stuck trying to do a input that takes a yes or no answer and then prints a string depending on the answer, the code seems right but anytime i try and open that same IDLE file that has the code it shows the input but when i type yes or no it just closes automatically without printing what it was asked

sample text:
shower = input('have you showered today?:')

if shower == 'yes':
print('good job ^^')
else:
print('take the nice cold shower ^^')

rough harborBOT
#

@paper plank

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

frank willow
#

Your sample code looks correct. I tested it and it runs without problems

dim rivet
#

It’s maybe the way you run your code

paper plank
# dim rivet It’s maybe the way you run your code

yeah i did some digging into the problem and it seems it was because i didnt even give it time to stay up so i just put at the bottom input('press enter to exit') so that i only exit after hitting enter rather than doing a quick print and closing itself

paper plank
dim rivet
#

glad you reach out by yourself !

paper plank
dim rivet
paper plank
#

oh alright

#

!close

rough harborBOT
#
Python help channel closed with !close

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.