python日常

# -*-coding:utf-8-*-
""" 如果注释里面需要中文  需要加上上面的代码"""
age = input('you think you input number ?')
age10 = int(age) + 10
print 'you age is ' + str(age10) 
""" 这里需要注意  输出的时候 需要将age10转换为str  """
ages = 3 * '5'
print type(ages)
"""<type 'str'>"""
jack1 = 3 * 5.0
print type(jack1)
"""<type 'str'>"""
print ('jack', 'hello', 'world')
print ('jack', 'java')
# 这是一个行注释  
""" 
这是一个行列注释
"""
print False == False
print False and False
print not True
# this is if 
number = input('you input win number ')
if number == 10:                           
    print 'yes '
elif number == 20:
    print 'no'
# this  is if two 
hopeyou = raw_input("you name ")
if hopeyou == 'jack':
    print'yes '
elif hopeyou == 'pcc':
    print 'you name is' + hopeyou
elif hopeyou == 'kt':
    print " yes"
else:
    print 'hack'
# this is if  elif
pwd = input('what is the passwordl ?')
if pwd == 'apple':
    print 'win'
elif pwd == 'a':
    print'root'
else:
    print 'out '

问题说明:根据作者使用 好像在使用 raw_input的时候在控制台进行输入的时候,当输入String or char的时候不要加引号.但是如果使用是input的话,必须使用引号

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值