Python nested If else program to describe the interview process

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
  1. Take two variables input from user round1 and round2 and assign the interview result as passed or failed.

  2. 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.

  3. 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

print a square or cube if the given number is divided by 2 or 3 respectively.

determine whether a given number is available in the list 

Leave a Comment