General Question
Can you help fix this programming problem in Python?
name = ”...”
school = ”...”
student = “Monday, 20/5/2019”
studentdetails = name + student + school
print(studentdetails)
teacherdaetails = {“teacherName”:“suh”,“teacheremail”:“suh@gmail.com”}
print(teacherdaetails)
print(”=”*50)
mass = []
print(“Enter the mass value”)
num = “0”
while num.isdigit():
num = input(“enter the mass value”)
if num.isdigit():
m = float(num)
mass.append(m)
print(mass)
acceleration=[]
print(“enter the acceleration values”)
num = “0”
while num.isdigit():
num = input(“enter acceleration value”)
if num.isdigit():
a=float(num)
acceleration.append(a)
print(acceleration)
print(max(mass))
print(min(acceleration))
Force = (“mass”[2]*“acceleration”[3])
print(Force)
print(”=”*50)
Traceback (most recent call last):
File “C:/Users/s118630/PycharmProjects/untitled/venv/Test 2.py”, line 38, in <module>
Force = (“mass”[2]*“acceleration”[3])
TypeError: can’t multiply sequence by non-int of type ‘str’
3 Answers
Answer this question
This question is in the General Section. Responses must be helpful and on-topic.