Why is it not taking the float values as input it's only taking integer values ?? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula gr√°tis
0

Why is it not taking the float values as input it's only taking integer values ??

30th Oct 2019, 3:38 AM
Suraj Rawat
Suraj Rawat - avatar
3 Respostas
+ 5
Sura Rawat, may be you want to use the sum of the numbers in your code? in this case the sum has to be stored in a variable. Anyway, it makes it difficult to asume what is your intend by only getting a small piece of code.
30th Oct 2019, 11:07 AM
Lothar
Lothar - avatar
+ 1
can you show an example in code? how are you doing it and what language?
30th Oct 2019, 6:39 AM
George Samanlian
0
This is a part of code and it's not taking a float value and sorry for the above post it's my first time trying python. >>> float(input("Enter a number: ")) + float(input("Enter another number: ")) Enter a number: 40 Enter another number: 2 42.0
30th Oct 2019, 7:03 AM
Suraj Rawat
Suraj Rawat - avatar