🎧 New: AI-Generated Podcasts Turn your study notes into engaging audio conversations. Learn more

Untitled
10 Questions
7 Views

Untitled

Created by
@SmoothestChalcedony

Podcast Beta

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</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</p> Signup and view all the answers

    break statement in python is used __________

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

    a loop block in python starts with a __________

    <p>:(colon)</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</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</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):</p> Signup and view all the answers

    Use Quizgecko on...
    Browser
    Browser