Idea logger

Hello everyone! Hope you’re having a great day!

I was working on this little project before I ran into a problem. I was working on an idea logger so I can write down ideas and the program would save it into a list so I can add ideas and read previous ones. I was working on this if statement but i’m running into a problem. Whenever I run the program, it asks me if I have any ideas (as expected). But, when I write “Yes” into the program, it shows me the “Thats ok! Make sure to keep working hard though!”. I tried putting the if “Yes” first but then even when i tell the program “No” it keeps asking me for the idea. Could someone please help me? Thank you!askidea console

It’s how you’re writing the conditionals.

In python you have to be explicit about every condition. Your first condition is evaluating like this:

print(False or "no")
#output "no"

Once you put the or, it doesn’t remember or take for granted anything that came before it, so you have to compare lower-case “no” once more.

print(False or "bread")
# "bread"
print(True or "bread")
# True
1 Like

So then how would I compare “no” once more? Would I have to create another if statement for that “no” and “yes”?

Both sides of the or have to be individual comparison statements. Right now you have one side is a comparison, and the other is just a plain string (not a comparison).

print(1 > 1 or 2 > 1)
#True

print(1 > 1 or 2 < 1)
#False

#yours at the moment looks like
print(1 > 1 or "word")
# word

print(1 > 1 or "word"=="werd")
#False

Etc. you can play around in the terminal with this type of idea to get a picture of what’s possible and what’s not.

2 Likes

Thank you so much! I fixed the or statement and it worked! :smiley:

2 Likes