HelpContactFor teachers and institutes
>_StemPy Lab
Mock TestsClasses

>_StemPy Lab

Learn. Solve. Code the solutions. Test yourself.

Live examsFree mock exams, timed and rankedEveryone starts together, and your score and rank come the moment it ends.See the exams →
Live examsInternational live exams are comingTell us which exam you want first. Timed practice papers are open now.See what is coming →

Learn

  • Physics
  • Chemistry
  • Mathematics
  • Biology
  • Python Programming
  • Statistics & Data Science
  • Computer Science
  • Space Science and Astronomy
  • Earth and Environmental Science
  • Classes
  • Groups

Practice

  • Problems
  • Quizzes
  • Mock Tests
  • Prepare for an Exam
  • Question Sets
  • Exams
  • Certificates
  • Python Labs
  • AI Practice Generator
  • Student-Created Tests

Community

  • Discussions
  • Resources
  • Notes
  • Glossary
  • Blog

Account

  • Log in
© 2026 senLearn. All rights reserved.HelpFor SchoolsAboutContactPrivacy PolicyTerms of UseRefund Policy
  1. Quizzes
  2. /A program counts some of the numbers in a list. The line inside the loop is missing, marked ____. Which lines fill the gap so that the program prints exactly 2? Choose two.
Python ProgrammingMediumHigh School (9–10)Python Basics › LoopsPCEP (Python Institute)
StemPy LabCreated by StemPy Lab

A program counts some of the numbers in a list. The line inside the loop is missing, marked ____. count = 0 for x in [2, 4, 6, 8]: ____ print(count) Which lines fill the gap so that the program prints exactly 2? Choose two.

One or more options are correct. Tick all the correct ones: a wrong option costs marks, and a part-right answer earns part of the marks.

Log in to save
← All Quizzes
← A dictionary says which letter comes after each letter. A while loop follows these links from "b" until there is no next letter. What does the program print?A sorted list is searched from both ends at once for two numbers whose sum is 15. Two indexes move toward each other. What does the program print? →
More onPython Basics › Loops

Discussion (0)

Log in to join the discussion.

Loading…

More questions on this topic

  1. In the middle of a for loop, the function tally puts 10 into i. It returns a sum and i together.…Hard
  2. A function should return the largest number of a list. For a list of negative numbers it gives the…Medium
  3. A while loop asks the function more whether to go on. That function also shows the number it was…Medium
  4. A function puts new numbers at the end of a list while a for loop runs over range(len(vals)). What…Medium
  5. A program searches a table, stored as a list of lists, for a negative number. It uses break…Hard
All questions on this topic →

Problems on this topic

  1. This loop should show the even numbers from 2 up to and including 10…Medium
  2. Write a program that asks for a password, again and again, until the user types python123…Medium
  3. Find the first number from 100 upwards that can be divided by both 6 and 8…Easy
  4. Asha saves 45 rupees every week, and has 0 at the start…Easy
All problems on this topic →