can some help me with my film databse code which is below,
i need to know how can i allow a single film to be displayed by index and how can i allow a film to be removed by index
anyone have any ideas #A list of entries
2 #Each element will be a dictionary
3 records =[]
4
5 #User input
6 user =""
7 while user !="0":
8 #display menu
9 print
10 print " Film Database "
11 print " -----------------"
12 print "1 -- Add entry "
13 print "2 -- List entries "
14 print "0 -- Exit "
15 print " -----------------"
16 print len ( records )," entries ."
17 print
18 print " Enter option :",
19
20 #Get user input
21 user = raw_input ()
22
23 if user =="1":
24 #Add to database
25
26 #Create empty dictionary
27 item ={}
28
29 print " Enter title :",
30 item [" Title "]= raw_input ()
31 print " Enter director :",
32 item [" Director "]= raw_input ()
33 print " Enter year :",
34 item [" Year "]= raw_input ()
35 records . append ( item )
36 elif user =="2":
37 #Display database
38 print "\t"+"-"*5
39 for r in records :
40 print " Title :\t\t",r[" Title "]
41 print " Year :\t\t",r[" Year "]
42 print " Director :\t",r[" Director "]
43 print "\t"+"-"*5
44 print
45
46 else :
47 print " Unknown option "

Please, use code tags. Your program is unreadable.

i did use the code tags but it didnt work can any python moderator plz sort the posts coding out so it can be readable

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.