3️⃣ pass

This keyword does nothing if the condition is True. The pass statement simply pass the execution to the next line.

Scenario: Use pass statement inside for loop to print odd numbers from a given list of numbers.

💻 Example:

1
2
3
4
5
6
7
nums=[1,2,3,4,5,6,7]

for num in nums:
    if num%2==0:
        pass
    else:
        print(num)

✅ Output:

1
3
5
7

Be prepared with below questions prior to your interview !

Frequently asked Interview Questions
  1. What are loop control statements in python?

  2. What is break keyword and its use?

  3. What is continue keyword and its use?

  4. What is pass keyword and its use?