Discussions Events Study Material Jobs
Create a dictionary with keys as subjects and values as marks. Print marks for a given subject using Python - Uniwaly

Explore Diverse Conversations

Create a dictionary with keys as subjects and values as marks. Print marks for a given subject using Python

Posted By: UmairMehmood Published On: 13 June 2025 At: 08:07 AM
#enter Camel case to see output
marks = {
    "Math" : 95,
    "English" : 88,
    "Urdu" : 67,
    "Science" : 98,
}
while True:
    subject = input("Enter Subject to get marks")

    if subject in marks:
     print(f"marks of {subject} ", marks[subject])
    else:
     print("Not Found")

Tags:

python python dictionary python dictionary with keys
Login to like

Posted By:

Author Profile

UmairMehmood

11 days ago

Join the conversation!

Login to Comment

Discover More Articles

How to Attestation of Degrees/Diplomas/Certificates From HEC ?

Ask user for an item and check whether it exists in a given tuple or not using Python

10-Day PhD Interview Prep Series: Essential Questions & Answers

Print All Even Numbers in a List using while loop in Python

Input 5 numbers from the user and store them in a list. Then print the list Using Python

Graphic Designer Jobs in Forest Department , PAKISTAN 2025

Write a program to reverse a list using a loop using Python

Child Protection and Welfare Bureau Jobs 2025

Kazakhstan Government Scholarship - How to Apply ? - Complete Detail

ASSISTANT PROFESSOR OF ENDOCRINOLOGY PPSC Jobs 14/2025 in SPECIALIZED HEALTHCARE & MEDICAL EDUCATION DEPARTMENT