Skip to content

Chapter 4 exception handling... error #30

@Evrywhere

Description

@Evrywhere

I tried running this code and I think I am not supposed to get the error instead it
prints "b can not be zero". This is the code:
a=input("type a number:")
b=input("type anothernumber")
a=int (a)
b=int(b)
try:
print (a/b)
except ZeroDivsionError:
print("b cannot be zero.")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions