Skip to content

Errors and Exceptions #2

@mnupura

Description

@mnupura

Errors and exceptions assignments:

  1. Handle the exception thrown by the code below by using try and except blocks.
    eg: for i in ['a','b','c']:
    print(i**2)
  2. Handle the exception thrown by the code below by using try and except blocks. Then use a finally block to print 'All done'
    eg: x=5, y=0
    z=x/y
  3. Write a function that asks for an integer and prints the square of it. use a while loop with a try,except,else block to account for incorrect inputs.

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