Tuesday, 25 January 2022

A) Write a Python program to input a positive integer. Display correct message for correct and incorrect input. (Use Exception Handling)

 Slip 13 Q 1

CODE:


try:
    num=int(input('Enter a number :'))
except ValueError:
    print("\nThis is not a number!")
else:
    print('\nnumber is : ',num)

OUTPUT:




No comments:

Post a Comment

Write a Java program to display given extension files from a specific directory on server machine.

 DOWNLOAD     SLIP14Q2 /** * STEPS TO RUN CODE * Step 01 compile the code * Step 02 run the code * Step 03 give a file directory locatio...