In this Python nested if-else program, we will describe the interview process depending on the round cleared by the applicant. The interview process consists of multiple rounds. If the candidate clears the first round then only he/she will move to the second round otherwise he/she will be removed from the process.
Hint:
Use nested if-else statements.
Steps to solve the program
- Take two variables input from user round1 and round2 and assign the interview result as passed or failed.
- If condition checks, if round1 is passed then the candidate, can appear for round2. If round2 is also passed then the candidate will be considered as placed.
- If a candidate failed in the first round1 then he can not appear for round2.
round1 = input("Enter round1 result:")
round2 = input("Enter round2 result:")
if round1 == "passed":
print("Congrats your 1st round is clear")
if round2 == "passed":
print("Congrats 2nd round is clear, you are placed")
else:
print("Failed in 2nd round, please try next time")
else:
print("Failed in 1st round, please try next time")
Output :
Enter round1 result :passed
Enter round2 result :failed
Congrats your 1st round is clear
Failed in 2nd round, please try next time
Enter round1 result :passed
Enter round2 result :passed
Congrats your 1st round is clear
Congrats 2nd round is clear, you are placed
Enter round1 result :failed
Enter round2 result :failed
Failed in 1st round, please try next time
Related Articles
Python program to determine whether a given number is available in the list of numbers or not.
Python program to find the largest number among three numbers.
Python program to check any person eligible to vote or not
Python program to check whether any given number is a palindrome.
Python program to check if any given string is palindrome or not.