HelpContactFor teachers and institutes
>_StemPy Lab
Mock TestsClassesGroups

>_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 →

Learn

  • Physics
  • Chemistry
  • Mathematics
  • Biology
  • Python Programming
  • Statistics & Data 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
  • Blog

Account

  • Dashboard
  • My Content
  • Profile
  • Log in
© 2026 senLearn. All rights reserved.HelpAboutContactPrivacy PolicyTerms of UseRefund Policy
  1. Quizzes
  2. /A program counts the letters of a word in a dictionary, and then asks the dictionary three things. What does the program print?
Python ProgrammingHardHigh School (9–10)Python Essentials › DictionariesPCEP (Python Institute)
StemPy LabCreated by StemPy Lab

A program counts the letters of a word in a dictionary, and then asks the dictionary three things. word = "abca" count = {} for ch in word: count[ch] = count.get(ch, 0) + 1 print(count, len(count), count.get("z")) What does the program print?

Log in to save
← All Quizzes
← A program updates a dictionary and asks it four questions. What does the program print?A program takes slices of a string, changes the case of letters, and searches for a letter. 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 program updates a dictionary and asks it four questions. What does the program print?Hard
  2. A record inside a record: what is {"Ravi": {"age": 12, "marks": [70, 88]}}["Ravi"]["marks"][0]?Medium
  3. What does print(sum({"a": 4, "b": 7, "c": 9}.values())) show?Medium
  4. stock = {"pen": 20}. After stock["pen"] = stock["pen"] - 5 and stock["ink"] = 3, what is len(stock)?Medium
  5. in looks at the keys. What does print("pen" in {"pen": 10, "ruler": 15}) show?Easy
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 →