python不能分配给操作员_Python解释器:无法分配给li

尝试一下你的意思:user_provided_value = raw_input("Say something:")

if user_provided_value == "v1":

print "Heavier than a duck!"

elif user_provided_value == "v2":

print "Lighter than a duck!"

else:

print "You must enter either v1 or v2"

你说的是(忽略v1和v2变量):('

#2 [ ('

= #3 to be the result of assigning

#5 to a tuple composed of

raw_input() #6 what the user types in at the prompt

, #7 (the comma operator creates a tuple)

('>') #8 And '>'

= # to be

raw_input() #4 what the user types in at the prompt

用易读的英语把这些行打出来,你是说:

“将''的结果。”。

说“将某个固定值设置为等于用户提供的值”等于说“将5设置为等于上一个方程的值”的代数等价物

*由于逗号运算符是绑定最少的运算符之一,您实际上正在将由字符串raw_input(), '>'组成的元组设置为等于第二个raw_input调用中的字符串。

该语句可分为以下几个部分:Set the string '' = raw_input()

raw_input(), '>' = raw_input()解释为:Set the tuple composed of the results of calling raw_input() and '>' to be equal to the results of calling raw_input()

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值