The first python program and the first python Program

Source: Internet
Author: User

The first python program and the first python Program

Import pickle as p

Linkmanfile = 'linkman. data'
# The name of the file where we will store the object

Linkman = {'hangzhou': '20140901 ',
'Xulisen': '20140901 ',
'Initui': '123 ',
'Yangangkuo': '123 ',
'Lijizhou': '123 ',
'Lifecylong': '20140901'
}
# Set up linkman data base

Print '% d lineman:' % len (linkman)
For name, qq in linkman. items ():
Print '% s: % s' % (name, qq)
# List original listing

Print '(1-search 2-delete 3-add 0-revise )'
# Prompting of operation

K = int (raw_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] =

Elif k = 0:
R = raw_input ('which revise :')
Linkman [r] = raw_input ('vised number :')
# Code of process

For name, qq in linkman. items ():
Print '% s: % s' % (name, qq)
# Print new listing

F = file (linkmanfile, 'w ')
P. dump (linkman, f)
# Put data into a file for using next

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.