Last answered:

11 Nov 2022

Posted on:

10 Nov 2022

0

synthax and value errors

1. I keep geting this error message when assigning float to str and also int to str.

far = float(input('please enter temperature in Farenheit:'))

ValueError: could not convert string to float: ''

2. Inability to type (') a single apostrophe when coding. it keeps giving me double '' instead.

please help

1 answers ( 0 marked as helpful)
Instructor
Posted on:

11 Nov 2022

0

Hey Pius,

Thank you for reaching out!

1. The reason you are getting the error is because you haven't provided a number, but rather an empty string. Please, study the code snippet below:
image.png
2. Usually, when you write quotation marks, you need two - an opening and a closing one. That is why when you type a single quotation mark, the second one appears automatically. That makes coding easier and prevents syntax errors. I am actually unaware of a way to type a single quotation mark.

Hope this helps!

Kind regards,
365 Hristina

Submit an answer