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. /Each step of a staircase is a different height. In one line, the program works out how much higher every step is than the step below it. What does the program print?
Python ProgrammingMediumHigh School (9–10)Python Basics › ListsPCEP (Python Institute)
StemPy LabCreated by StemPy Lab

Each step of a staircase is a different height. In one line, the program works out how much higher every step is than the step below it. v = [3, 7, 8, 12] rise = [v[i] - v[i - 1] for i in range(1, len(v))] print(rise, max(rise), len(rise)) What does the program print?

Log in to save
← All Quizzes
← A theatre stores its seats in a dictionary. Each key is a tuple of a row number and a seat letter. What does the program print?A program should group words by their first letter, in a dictionary of lists. It stops with KeyError. The lines are numbered from 1. Which changes make the program print {'a': ['ant', 'ape'], 'b': ['bee', 'bat']}? Choose two. →
More onPython Basics › Lists

Discussion (0)

Log in to join the discussion.

Loading…

More questions on this topic

  1. A function builds a list from one column of a table that is a list of lists. Then the program…Hard
  2. A function deletes an item of a list by its index, and returns the new length. It is called twice…Medium
  3. Some list methods change the list and give back None. A function such as sorted() gives back a new…Medium
  4. A function sorts the list it is given, and then returns a slice of it. The caller changes the…Medium
  5. A program deletes a slice with a step from a list, and then adds one item. What does the program…Hard
All questions on this topic →

Problems on this topic

  1. Here is a table of marks: one row for each student, and one column for each test…Medium
  2. What do a and b show at the end? Say it before you run it.Medium
  3. The list is marks = [45, 78, 90, 62, 38, 85, 71]…Easy
  4. Find the positionEasy
All problems on this topic →