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 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?
Python ProgrammingMediumHigh School (9–10)Python Essentials › DictionariesPCEP (Python Institute)
StemPy LabCreated by StemPy Lab

A theatre stores its seats in a dictionary. Each key is a tuple of a row number and a seat letter. seats = {(1, "A"): "Ann", (1, "B"): "Raj", (2, "A"): "Mo"} row1 = [] for key in seats: if key[0] == 1: row1.append(key[1] + ":" + seats[key]) print(row1, (2, "A") in seats, ("A", 2) in seats) What does the program print?

Log in to save
← All Quizzes
← A program unpacks a tuple into two names, and then makes a longer tuple with +. What does the program print?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? →
More onPython Essentials › Dictionaries

Discussion (0)

Log in to join the discussion.

Loading…

More questions on this topic

  1. A function adds up points for the letters of a word. Letters that are not in the dictionary get a…Medium
  2. A loop doubles every value of a dictionary, taking the keys in sorted order. Then the program…Hard
  3. A program should group words by their first letter, in a dictionary of lists. It stops with…Medium
  4. A price list is kept in a dictionary. The program changes one price, adds an item, and removes…Medium
  5. A program counts the letters of a word in a dictionary, and then asks the dictionary three things.…Hard
All questions on this topic →

Problems on this topic

  1. Group these words by their length, in a dictionary where the key is the length and the value is the…Medium
  2. For this dictionary, write the expression for each answer…Medium
  3. Write a program that counts how many times each letter appears in the word mississippi, and shows…Easy
  4. Say whether a list or a dictionary is the better choice for each, and why…Easy
All problems on this topic →