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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!