Assignmnet 5 Task 1: Create a Dictionary of Student Marks This part of the program demonstrates how to use a Python dictionary to store and retrieve student marks:
A dictionary called student_marks is created, where each key is a student's name and the value is their marks.
The user is prompted to enter a student's name.
The program checks if the entered name exists in the dictionary:
If found, it prints the student's marks.
If not found, it prints "Student not found."
This is a basic example of how dictionaries can be used for quick lookups based on a key (in this case, the student's name).
Task 2: Demonstrate List Slicing This part of the program shows how to use list slicing in Python:
A list called numbers is created with values from 1 to 10.
The first five elements are extracted using slicing (numbers[:5]).
These extracted elements are then reversed using slicing with a step of -1 (first_five[::-1]).
The program prints the original list, the first five elements, and the reversed version of those elements.