import turtle as t
t.shape('turtle')
color=float(input('turtle color==>')
t.pencolor("color")
I don't understand why there is an error. Numbers work, but strings don't work.
python
>>> float("33")
33.0
>>> float("abcde")
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
float("abcde")
ValueError: could not convert string to float: 'abcde'
>>> float(input(""))
11.11
11.11
>>> float(input(""))
1
1.0
>>> float(input(""))
red
Traceback (most recent call last):
File "<pyshell#6>", line 1, in <module>
float(input(""))
ValueError: could not convert string to float: 'red'
>>>
© 2025 OneMinuteCode. All rights reserved.