Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

What will be the output of the following Python code?
names1 = [‘Amir’, ‘Bala’, ‘Chales’]
if ‘amir’ in names1:
print(1)
else:
print(2)

What will be the output of the following Python code?
names1 = [‘Amir’, ‘Bala’, ‘Chales’]
if ‘amir’ in names1:
print(1)
else:
print(2)
a) none
b) 1
c) 2
d) error

Answer: c
Explanation: Execute in the shell to verify.

Join The Discussion