Why isn’t 2nd message printing? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why isn’t 2nd message printing?

So I have this code: input1=input() strinput1=str(input1) if int(input1)>=int(1001): print("Input must be less than 1000") elif not input1 print("Input1: Please enter a value") else: print("Input1:"+strinput1) input2=input() strinput2=str(input2) if int(input2)>=int(251): print("Input must be less than 250") elif not input2 print("Input2: Please enter a value") else: print("Input2:"+strinput2) I’m trying to make a code that takes inputs and: •prints a message if the inputs are over a certain number •prints a different message if there is no input •prints the inputted values if there are no issues with the above 2 points When I run this code with no input, only the message for the 1st blank input gets printed. If I run it with 1 input, the message about the 2nd blank input value doesn’t get printed. Why is this happening and is there a way to get the 2nd message about blank input to print when I run the code with no/only 1 input?

25th Jun 2020, 4:35 AM
•—• • •-• ••• —- -•
•—• • •-• ••• —- -• - avatar
1 Answer
0
•—• • •-• ••• —- -• This may be a bit of overkill, but maybe you can adapt it to your needs https://code.sololearn.com/c6GWQYvqROe0/?ref=app
25th Jun 2020, 6:04 AM
Ipang