Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+4 votes

Hi, I'm doing the first question and I am having trouble converting the input to a float? I am not sure how to get it correct.

asked in CSC201 Spring 2021 by (1 point)

1 Answer

+2 votes
 
Best answer

you can convert the input to a float with float(), but only if the user does not enter the empty string, "". So you'll want to get the input, then use an 'if not' statement to check for the empty string, and then convert in the if statement.

answered by (1 point)
selected by
+1

Thank you again Furby! :)

...