Python Forum
Problem with very easy code.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem with very easy code.
#1
Hi! So today I started coding with Python, and I wanted to create this easy code, where you need to answer with: yes or no. It's not working, everytime, when I type "no" it always shows me "good answer!". How do I fix that?

fruits = input("do you like fruits?: ")

yes = input
no = input

if yes:
print("good answer!")
else:
print("bad answer!")
I don't really now what I am doing.
buran write Dec-10-2020, 12:49 PM:
Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.
See BBcode help for more info.
Reply


Messages In This Thread
Problem with very easy code. - by janekk9002 - Dec-10-2020, 12:45 PM
RE: Problem with very easy code. - by buran - Dec-10-2020, 12:57 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Code problem - probably easy fix? colin_dent 5 945 Jun-30-2023, 01:55 PM
Last Post: deanhystad
  easy name problem Steinsack 1 1,761 Jun-16-2021, 02:03 PM
Last Post: snippsat
  What was my mistake in this Python code (easy)? voltman 4 3,489 Nov-19-2019, 09:58 PM
Last Post: snippsat
  How to start with this easy problem? Fran 8 4,222 Sep-11-2018, 09:04 AM
Last Post: Fran
  Making a Easy Password/code system nmsturcke 4 3,885 Jul-09-2018, 02:50 AM
Last Post: ichabod801
  probably a easy problem for you krheigh 4 4,696 May-12-2017, 06:45 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020