Новый курс! Каждый программист должен знать генеративный ИИ!
+ 3

# Can someone help me out with type conversion please

10th May 2020, 3:05 AM
Käī
16 ответов
+ 3
Thank youuu
10th May 2020, 3:09 AM
Käī
+ 3
Käī Just write it like so : num1 = int(input('Enter a number')) num2 = int(input('Enter another number')) print(float(num1*12) + float(num2*6))
10th May 2020, 3:45 AM
+ 2
In which language?
10th May 2020, 3:06 AM
10th May 2020, 3:07 AM
Käī
+ 2
To make integer to string : str(10) # '10' To make string to integer : int('10') # 10 To make int to float float(10) # 10.0
10th May 2020, 3:09 AM
+ 2
Hey I have another question How do I do Print(float(input("enter a number: "))) + Float(input("enter another number:"))
10th May 2020, 3:14 AM
Käī
+ 2
Thanks :))
10th May 2020, 3:18 AM
Käī
+ 2
Srry to bother you again but I got a error When I did this: print(float(12*int("Enter a number: ")) + float(6*int("Enter another number: "))) num1 = float(12*int('Enter a number:')) num2 = float(6*int('Enter another number')) print(num1 + num2)
10th May 2020, 3:42 AM
Käī
+ 2
Did I do something wrong
10th May 2020, 3:44 AM
Käī
+ 2
You could also do something like: print(float(input('Enter a number:')) + float(input('Enter another number:'))) You just had to move ')' to the end.
10th May 2020, 3:46 AM
ChaoticDawg
+ 2
Hey it's me again I did it but I still got a error: num1 = int(12('Enter a number:')) num2 = int(6('Enter another number')) str(12) # 12.0 str(6) # 6.0 print(float(num1*12) + float(num2*6)) Print(float(input("Enter a number: ")) + float(float(input("Enter another number: ")))
10th May 2020, 4:26 AM
Käī
+ 1
Here you go :)) num1 = float(input('Enter a number')) num2 = float(input('Enter another number')) print(num1 + num2)
10th May 2020, 3:16 AM
+ 1
Hey I tried ur way but am still getting error
14th May 2020, 3:49 PM
Käī
+ 1
I tried this num1 = float(int * 12('Enter a number:')) num2 = float(int * 6('Enter another number')) print((num1 * 12) + (num2 * 6))
14th May 2020, 3:50 PM
Käī
0
this app is so helpful ! XD
8th Nov 2021, 4:37 PM
Dan Walker
0
You can do this: integer = int(input()) integer2 = int(input()) print(integer * integer2)
16th Nov 2021, 12:22 PM
TJ Yoo
Актуальное сегодня
BOTSS