R

Ram Sharma • 193.86K Points
Coach

Q. What will be the output of given Python code?

Code:
str1="hello"
c=0
for x in str1:
   if(x!="l"):
       c=c+1
   else:
       pass
print(c)
  • (A) 0
  • (B) 2
  • (C) 3
  • (D) 4
  • Correct Answer - Option(C)
  • Views: 128
  • Filed under category Python

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.


Question analytics