标签:key int alt 用户名 import nts nbsp code put
一、输入/加密
#!/usr/bin/python
#coding:utf-8
import getpass
name = raw_input(‘请输入用户名:‘)
pwd = getpass.getpass(‘请输入密码:‘)
if name == "alex" and pwd == "cmd":
print "欢迎,alex!"
else:
print "用户名和密码错误"
二、enumrate
li
=
[
11
,
22
,
33
]
for
k,v
in
enumerate
(li,
1
):
print
(k,v)
print
range
(
1
,
10
,
2
)
# 结果:[1, 3, 5, 7, 9]
print
range
(
30
,
0
,
-
2
)
# 结果:[30, 28, 26, 24, 22, 20, 18, 16, 14, 12, 10, 8, 6, 4, 2]
标签:key int alt 用户名 import nts nbsp code put
原文地址:http://www.cnblogs.com/liwenzhen238/p/6185603.html