FlareStart
HomeNewsHow ToSources
FlareStart

Where developers start their day. All the tech news & tutorials that matter, in one place.

Quick Links

  • Home
  • News
  • Tutorials
  • Sources
  • Privacy Policy

Connect

© 2026 FlareStart. All rights reserved.

Back to articles
Task – Annachi Kadai – Python Dictionary
How-ToMachine Learning

Task – Annachi Kadai – Python Dictionary

via Dev.to BeginnersHaripriya V3h ago

1.Create a dictionary named student with the following keys and values. and print the same "name": "Alice" "age": 21 "major": "Computer Science" CODE: student = { "name": "Alice", "age": 21, "major": "Computer Science" } print(student) OUTPUT: {'name': 'Alice', 'age': 21, 'major': 'Computer Science'} EXPLANATION: A dictionary stores data as key-value pairs Keys: name, age, major 2.Using the student dictionary, print the values associated with the keys "name" and "major". CODE: print(student["name"]) print(student["major"]) OUTPUT: Alice Computer Science EXPLANATION: Use keys to access values 3.Add a new key-value pair to the student dictionary: "gpa": 3.8. Then update the "age" to 22. CODE: student["gpa"] = 3.8 student["age"] = 22 print(student) OUTPUT: {'name': 'Alice', 'age': 22, 'major': 'Computer Science', 'gpa': 3.8} EXPLANATION: New key added Existing key updated 4.Remove the key "major" from the student dictionary using the del statement. Print the dictionary to confirm the remo

Continue reading on Dev.to Beginners

Opens in a new tab

Read Full Article
7 views

Related Articles

How to Back Up Your Android Phone (2026)
How-To

How to Back Up Your Android Phone (2026)

Wired • 2h ago

Mining the deep ocean
How-To

Mining the deep ocean

Ars Technica • 3h ago

CA 08 - Sort 0s, 1s, and 2s
How-To

CA 08 - Sort 0s, 1s, and 2s

Dev.to • 4h ago

PDF to LaTeX Conversion: Why It's Hard and What Actually Works
How-To

PDF to LaTeX Conversion: Why It's Hard and What Actually Works

Dev.to Tutorial • 4h ago

The Art of Motivation and Inspiration ✨
How-To

The Art of Motivation and Inspiration ✨

Medium Programming • 6h ago

Discover More Articles