0
Why do i get TypeError here?
7 Antworten
+ 3
You can also do it without type convertion by using a comma:
print('your weight in Kg: ', kweight)
+ 2
thanx guys, i got to know that even in print function you can only concatinate a string WITH A string. python itself said so...
+ 1
u can t add a string to a float u have to convert it
+ 1
Also you can use a f-string.
print(f'Your weight: {kweight}')
0
to a string
0
u have to replace it with str(kweight)