Question: Hello, this below Python code doesn't work bescause I change variable xfactor to a str and now I will test the below code in pytest.
Hello, this below Python code doesn't work bescause I change
variable xfactor to a str and now I will test the below code in pytest.
I run the file in terminal and I can't get it right with the command
pytest please help to get i correct.
The answer I get in terminal is "no test ran in 0.00s"
Thanks!
age = int
xfactor = str
try:
#with open("mosh1.py") as file:
print("File opened")
age = int(input("Age: "))
print(("Your age:"), age / xfactor)
except (ValueError, ZeroDivisionError):
print("Not valid input")
else:
print("No exceptions were thrown")
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
