0
Name reader.
Wanted to make a code in python that will print a name that you input. Can someone tell me what I did wrong? input = name1 name1 = float(input("Enter a name”) print(“name1”) Sorry if this is a basic question, just trying to wrap my head around this.
3 odpowiedzi
+ 1
I see two errors, 1° you defined a variable name1 as a float number (line 2), 2° when you write "number" the print statement is set to print a string but not a variable number1 (line 3).
+ 2
change float to str. Name is mostly represented as string
+ 1
Float is for decimal numbers not strings such as names