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 function decides with not, or and and in one condition, and has no brackets to show the order. What does the program print?
Python ProgrammingHardHigh School (9–10)Python Basics › Conditionals: if, elif, elsePCEP (Python Institute)
StemPy LabCreated by StemPy Lab

A function decides with not, or and and in one condition, and has no brackets to show the order. def pick(x, y): if not x or y and x > y: return "first" elif x == y or not y: return "second" return "third" print(pick(0, 5), pick(4, 2), pick(3, 3), pick(2, 9)) What does the program print?

Log in to save
← All Quizzes
← Each number of a list should give one letter: A, B or C. The test in the if line is left out, and ____ stands in its place. Which condition fills the gap so that the output is exactly BCA?In the middle of a for loop, the function tally puts 10 into i. It returns a sum and i together. 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. Each number of a list should give one letter: A, B or C. The test in the if line is left out, and…Medium
  2. A program reads an operator and a number from the keyboard, and passes both to a function. The…Medium
  3. A function sorts values by whether they count as true or false in an if test. What does the…Medium
  4. A function picks a word for a temperature with if, elif and a final return. What does the program…Easy
  5. A program checks a basket, which is a list, before it adds a fruit. What does the program print?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 →