Python Forum

Full Version: I am an absolute newbie.Help me!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
print("If your credit score is good type G")
print("if your credit score is bad type B")
credit_score = input("Please enter your credit score now")

if credit_score in ['g','G']:
    print("Your down payment is .1 million")
elif credit_score in ['b','B']:
    print("Your down payment is .2 million")
I am trying to write a program that outputs the downpayment for a house purchase based on whether a person's credit rating is good or not. I am getting the reply "Process finished with exit code 0".Please tell me what is wrong with my code.
it's working perfectly fine. how do you run it?
I ran the code in Pycharm. This is the output.

Output:
If your credit score is good type G if your credit score is bad type B Please enter your credit score now B Process finished with exit code 0
it looks like you enter extra space, i.e. ' B', not 'B'.
You can add this space in the prompt, e.g.
credit_score = input("Please enter your credit score now ")
Yes. You are right.Awesome.My code worked. Thank you.