-1

I am making a quick problem solver, it takes the speed (input) and time (also input) than multiplies them to get the distance... the problem is that python thinks the inputs are strings, how do i make them numbers???

my code so far is:

py
import random

time = input("What is the time it took? (no label :: ")
speed = input("What was the speed?(no label :: ")
s = speed
t = time
distance = s * t
print(time)
print(speed)
print(distance)

Nico.
  • 1
  • 1

1 Answers1

0

You should be able to simply cast the String input to an Integer. Doing as follows will give you the desired output.

s = int(speed)
t = int(time)
Sarth Shah
  • 73
  • 4