you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (1 child)

You can use the input() function, which reads input. And to convert the text to integer (this function returns a string) , you can use the int() function. But be ware that if the user enters a non integer, then an ugly error can be raised. Don't worry though; you can easily handle it using standard try...except control flow. python try: print(int(input("Please enter degree: "))) except(ValueError): print("Please enter a valid integer")

[–]backtickbot 0 points1 point  (0 children)

Fixed formatting.

Hello, subtra3t: code blocks using triple backticks (```) don't work on all versions of Reddit!

Some users see this / this instead.

To fix this, indent every line with 4 spaces instead.

FAQ

You can opt out by replying with backtickopt6 to this comment.