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?
print(“abcdef”.find(“cd”) == “cd” in “abcdef”)

What will be the output of the following Python code?
print(“abcdef”.find(“cd”) == “cd” in “abcdef”)
a) True
b) False
c) Error
d) None of the mentioned

Answer: b
Explanation: The function find() returns the position of the sunstring in the given string whereas the in keyword returns a value of Boolean type.

Join The Discussion