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 checks a basket, which is a list, before it adds a fruit. What does the program print?
Python ProgrammingEasyHigh School (9–10)Python Basics › Conditionals: if, elif, elsePCEP (Python Institute)
StemPy LabCreated by StemPy Lab

A program checks a basket, which is a list, before it adds a fruit. basket = ["apple", "pear"] fruit = "plum" if fruit in basket: print("have it") elif len(basket) < 3: basket.append(fruit) print("added", len(basket)) else: print("full") What does the program print?

Log in to save
← All Quizzes
← A student turns values into numbers with int() and float(). Each line below is tried on its own. Which lines run without an error? Choose three.A program searches a list of tuples for a number whose double is 5. If the search fails, it reports the last tuple it saw. What does the program print? →
More onPython Basics › Conditionals: if, elif, else

Discussion (0)

Log in to join the discussion.

Loading…

More questions on this topic

  1. A function decides with not, or and and in one condition, and has no brackets to show the order.…Hard
  2. Each number of a list should give one letter: A, B or C. The test in the if line is left out, and…Medium
  3. A program reads an operator and a number from the keyboard, and passes both to a function. The…Medium
  4. A function sorts values by whether they count as true or false in an if test. What does the…Medium
  5. A function picks a word for a temperature with if, elif and a final return. What does the program…Easy
All questions on this topic →

Problems on this topic

  1. Write a simpler condition, without a not in front of a bracket, that is the same as each of these…Medium
  2. At a club door the guard asks the age first…Medium
  3. This program should say a vowel only for the letters a, e, i, o and u…Medium
  4. The ticket price rules are: under 5 free, under 13 pays 50, under 60 pays 100, and the rest pay 70…Medium
All problems on this topic →