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. /An if statement has another if inside it, and the first test compares two strings. What does the program print?
Python ProgrammingMediumHigh School (9–10)Python Basics › Conditionals: if, elif, elsePCEP (Python Institute)
StemPy LabCreated by StemPy Lab

An if statement has another if inside it, and the first test compares two strings. word = "Loop" if word < "loop": if len(word) > 3: print("A") else: print("B") elif word == "loop": print("C") else: print("D") What does the program print?

Log in to save
← All Quizzes
← A while loop walks through a word with an index. After it finds the letter a, it jumps two places ahead. What is printed?Two nested counting loops add up numbers. The inner range starts at the outer variable, so the inner loop gets shorter each time round. 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 →