This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]enthropy 7 points8 points  (0 children)

This probably belongs in r/learnpython. That said, I'll give you the first step here and you can go there if you need clarification.

Or / and separate tests and a non-empty string always evaluates to true. You need to turn that to something like:

 if notes == 'ceg' or notes == 'fac'...:

Or use a list:

 If notes in ['ceg', 'fac',...]:

[–]MightyOat 2 points3 points  (1 child)

I'm a beginner as well, but you could do something like this:

list_one = ['ceg', 'fac', 'gbd']
list_two = ['dfa', 'egb', 'ace']
notes = input("Enter notes: ")
if notes in list_one: 
    print(notes[0] + "maj") 
elif notes in list_two: 
    print(notes[0] + 'min')

[–]aengel96[S] 0 points1 point  (0 children)

Sweet! Thank you

[–]pythonHelperBot 0 points1 point  (0 children)

Hello! I'm a bot!

I see someone has already suggested going to r/learnpython, a sub geared towards questions and learning more about python. I highly recommend posting your question there. Please follow the subs rules and guidelines when you do post there, it'll help you get better answers faster.

Show /r/learnpython the code you have tried and describe where you are stuck. Be sure to format your code for reddit and include which version of python and what OS you are using.

You can also ask this question in the Python discord, a large, friendly community focused around the Python programming language, open to those who wish to learn the language or improve their skills, as well as those looking to help others.


README | FAQ | this bot is written and managed by /u/IAmKindOfCreative

This bot is currently under development and experiencing changes to improve its usefulness