Professional Documents
Culture Documents
Friday, May 19, 2023 6:05 PM
Friday, May 19, 2023 6:05 PM
AAABBC
D:\> d={'A':3,'B':1}
x=B
d[x]=d.get(x,0)+1
d[B]=d.get(B,0)+1
d[B]=1+1
d[B]=2
d={'A':3,'B':2}
d={'A':3,'B':2}
x=C
d[x]=d.get(x,0)+1
d[C]=d.get(C,0)+1
d[C]=0+1
d[C]=1
d={'A':3,'B':2,'C':1}
A occurred 3 times
B occurred 2 times
C occurred 1 times
Assignment:
Sample output:
apple
a occurred 1 time
e occurred 1 time
python
o occurred 1 time
Write a program to accept student name and Mark from the keyboard and
create a dictionary . Also display student Marks by taking student name as
input.
Program:
output:
D:\>python program1.py
Enter the number of students:5
Enter student name:suresh
Enter student marks:96
Enter student name:krishna
Enter student marks:88
Enter student name:kumar
Enter student marks:99
Enter student name:kiran
Enter student marks:45
Enter student name:srinivas
Enter student marks:98
Enter student name to get marks:kiran
The marks of kiran are 45
Do you want to find another student marks[yes|no]yes
Enter student name to get marks:kumar
The marks of kumar are 99
Do you want to find another student marks[yes|no]yes
Enter student name to get marks:praveen
Student not found
Do you want to find another student marks[yes|no]No
Thank you for using this application
Mini project
Online quiz
output:
D:\>python program1.py
Enter your name:suresh
Hello suresh Welcome to the Quiz
D:\>