repl.it
@Geocube101/

[ASK] {For: ruchiyadav}

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
PartyName={}
while True:
	print("""what you wish to do:
		1.Insert party name
		2.Update party name
		3.Delete party name
		4.View all party name
		5.Exit""")
	choice= int(input("Enter your choice: "))
	if choice==1:
		val= input("Enter party name: ")
		key= input("Enter party abbriviation: ")
		PartyName[key]= val
	elif choice==2:
		key= input("Enter Party abbriviation that you wish to change: ")
		if key not in PartyName:
			print("Wrong Input")
		else:
			del PartyName[key]
			val= input("Enter party name: ")
			key= input("Enter party abbriviation: ")
			PartyName[key] = val
	elif choice==3:
		key= input("Enter Party abbriviation that you wish to delete: ")
		if key not in PartyName:
			print("Wrong Input")
		else:
			del PartyName[key]
	elif choice==4:
		for key, val in PartyName.items():
			print(key+'-'+val)
	elif choice==5:
		break