+ 1
(solved) Is it possible to multiply two variable inputs together and if so how do you do it?
I'm trying to create a program that will calculate the cost for me for items that I 3-D print and then sell, but I cant figure out how to get it to work.
3 Answers
+ 2
In python to get the input from user you need to use the function: input()
if you need to take a number as input you need to cast the type into int or float like this:
a = float(input())
b = float(input())
use int if you need only integer type:
a = int(input())
Anyway if you show your code we can help you better...
+ 1
a = 2
b = 3
print(a * b)
// Output: 6
Or if you want to store the result in a new variable:
c = a * b
print(c)
0
I'm trying to get it to where i input two variables and it calculates the cost for me. Do you know how to do this?