Program to display 1/0 if the user gives Hello/Bye as output.

In this python if else program, we will display 1/0 if the user gives Hello/Bye as output.

Steps to solve the program
  1. Take input through the user.
  2. Using an if-else statement display 1/0 if the user gives Hello/Bye as output.
  3. Print the respective output.
				
					iput = input("Enter your choice: ")

if iput == "Hello":
    print(1)
elif iput == "Bye":
    print(0)
else:
    print("Invalid choice")
				
			

Output :

				
					Enter your choice: Bye
0
				
			

Related Articles

check whether the last digit of a number defined by the user is divisible by 4 or not.

accept the car price of a car and display the road tax to be paid

Leave a Comment