The first Python program

Source: Internet
Author: User

Import PickleAs P

Linkmanfile =' Linkman.data '
#the name of the file where we'll store the object

Linkman = {' Zhangyunpeng ':' 434498027 ',
' Xuleisen ':' 405929608 ',
' Yinrui ':' 1650502423 ',
' Yancangkuo ':' 1046287430 ',
' Lijizhou ':' 641224214 ',
' Liuyulong ':' 1919734130 '
}
#set up Linkman Data base

Print'%d lineman: '%Len (Linkman)
For nameQqIn Linkman.items ():
Print'%s:%s '% (name, QQ)
#list Original Listing

Print' (1-search 2-delete 3-add 0-revise) '
#prompting of Operation

K =intRaw_input (' Please input: ')
if k = =1:
s =Raw_input (' Search the Linkman Name: ')
Print'%s '% linkman[s]

elif k = =2:
D =Raw_input (' Delete the Linkman name: ')
Del Linkman[d]

elif k = =3:
A =Raw_input (' Add the Linkman name: ')
A =Raw_input (' Add the Linkman number: ')
Linkman[a] = a

elif k = =0:
R =Raw_input ( ' which revise: ')
Linkman[r] = raw_input ( revised number: ')
Span style= "color: #808080;" > #code of process

for name< Span style= "color: #cc7832;" >, QQ in Linkman.items ():
print %s:%s '% (Name #print new Listing

F = file (Linkmanfile, ' W ')
P.dump (Linkman #put data into a file for using next

First Python program

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.