End of Python Enter

Asked 2 years ago, Updated 2 years ago, 24 views

Hello! I'm a student studying Python hard! I'm asking you a question because I found something I didn't know while studying. Please take good care of me. :)

I have to complete it as given in the picture above, but I have two questions, so I'm asking you.

One is to end the program by entering Enter, and the other is that I don't know that the output value comes out without a sign when I enter +25! Thank you.

python

2022-09-22 18:00

1 Answers

In the input requested by input, if you enter an enter immediately without entering anything, the return value of the input() function is a bin string ".

You can inspect this condition and exit the for statement.

Please think about how to test it yourself first.


2022-09-22 18:00

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.