Update Values

Easy Dictionaries PRO
🔒 Login to Unlock

Problem Statement

Write a Python program to update an existing key’s value in a dictionary and print the updated dictionary.

Input Format

A new integer value for the key 'price' in a predefined dictionary `{'item': 'Pen', 'price': 10}`.

Output Format

Print the updated dictionary.

Constraints

Valid integer price

Sample Input

25

Sample Output

{'item': 'Pen', 'price': 25}

Explanation

Modify dictionary values by assigning to the key directly.

Starter Code

def update_dict(new_price):
    item_dict = {'item': 'Pen', 'price': 10}
    # Write your code here
    pass

new_price = int(input())
print(update_dict(new_price))

Limits

  • Time Limit: 1s
  • Memory Limit: 256MB

Embedded C Programming

Updated: March 15, 2026
Intermediate

Embedded systems rely on efficient low-level programming to interact directly with hardware. In this course, you will learn how to write practical Embedded C programs used in real microcontroller-based systems. Rather than focusing only on theory, this course follows a practice-driven approach. Each lesson includes hands-on coding exercises that simulate real firmware development tasks used