Untitled
10 Questions
7 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

what will be the output of the following code: i=0 while i<=6: i=i+1 if(i==3): continue print(i)

  • 1,2,4,5,6,7 (correct)
  • 1,2,3,4,5,6
  • 1,2,3,4,5,6,7
  • 1,2,4,5,6

what will be the output of the following code: i=1 sum=0 while(i<=5): sum=sum+i i+i+1 print(sum)

  • 5
  • 10
  • 15 (correct)
  • 20

what will be the output of the following code: c=0 for letter in 'Tamilnadu': if letter !='I': c=c+1 pass print(c)

  • 5
  • 6
  • 7
  • 8 (correct)

what will be the output of the following code: for i in range(1,6,2): print(i,end=" ")

<p>1 3 5 (B)</p> Signup and view all the answers

what will be the output of the following code: a,b=12,5 if a+b: print('true') else: print('false')

<p>true (A)</p> Signup and view all the answers

break statement in python is used __________

<p>to terminate a loop (C)</p> Signup and view all the answers

a loop block in python starts with a __________

<p>:(colon) (D)</p> Signup and view all the answers

what will be the output of the following code? for i in range(1,4): print(i) break else: print("no break")

<p>1 (A)</p> Signup and view all the answers

how many time will the following loop execute? i=2 while(i>0): i=i-1

<p>2 (B)</p> Signup and view all the answers

which of the following is a valid for loop in python?

<p>for i in range(0,5): (C)</p> Signup and view all the answers
Use Quizgecko on...
Browser
Browser