Write a python program to increment a number if it is positive.PROGRAM:a=int(input("Enter a number:"))if (a>0): a=a+1 print("Number:",a)else: print("Sorry! It's not a positive number.")OUTPUT:Enter a number: 5Number: 6Enter a number: -2Sorry! It's not a positive number.
No comments:
Post a Comment