>>> float(input("Enter a number: ")) + float(input("Enter another number: ")) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

>>> float(input("Enter a number: ")) + float(input("Enter another number: "))

In type conversation someone to explain to me literally..with an example Cause I don't get the point..

23rd Apr 2020, 12:03 PM
Tonny
Tonny - avatar
6 Answers
0
Mention the language in tags ,ty
23rd Apr 2020, 12:17 PM
Abhay
Abhay - avatar
23rd Apr 2020, 12:18 PM
Tonny
Tonny - avatar
0
So what you don't understand about type conversion? Like for example Input() returns string so you need to convert it to int type if you want integer input from user
23rd Apr 2020, 12:21 PM
Abhay
Abhay - avatar
0
>>> float(input("Enter a number: ")) + float(input("Enter another number: ")) Here is an example can you work this for me
23rd Apr 2020, 12:23 PM
Tonny
Tonny - avatar
0
You should do some self search and go through python course ,it's obviously converting a string input into float type, like 4.5 or 4 will simply return string and string works differently from integers or floats ,strings have different methods , so you will want to convert it to float type or whatever type so you can perform the desired operations on it
23rd Apr 2020, 12:28 PM
Abhay
Abhay - avatar
0
In your example it's adding two float numbers
23rd Apr 2020, 12:29 PM
Abhay
Abhay - avatar