Student Database

Medium Dictionaries PRO
🔒 Login to Unlock

Problem Statement

Write a Python program to add a new student record into a dictionary database and print the sorted records by student ID keys.

Input Format

Line 1: Student ID key. Line 2: Student name value.

Output Format

Print the complete sorted dictionary.

Constraints

Valid keys and values

Sample Input

103
Charlie

Sample Output

{101: 'Alice', 102: 'Bob', 103: 'Charlie'}

Explanation

Preload database `{101: 'Alice', 102: 'Bob'}`, add the new entry, and sort keys.

Starter Code

def add_student(sid, name):
    db = {101: 'Alice', 102: 'Bob'}
    # Write your code here
    pass

sid = int(input())
name = input()
print(add_student(sid, name))

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