- 帖子
- 2
- 精华
- 0
- 积分
- 10
- 阅读权限
- 10
- 注册时间
- 2018-2-2
- 最后登录
- 2018-2-22
|
自己编的,大神来帮忙看看行不行。另外,问一个特别傻的问题。在IDLE里每次编完一段想单独跑这段怎么操作?每次用F5就是全部跑了,刚接触,还不太熟悉。
word='big god'
print ("Who do you think I am?")
answer=input()
if answer==word:
print("Oh, yes. You are right, man!")
if answer=='bad guy':
print('No!I cannot agree with you!')
跑出来的结果就是:
==================== RESTART: C:\Users\文博\Desktop\Test.py ====================
Who do you think I am?
big god
Oh, yes. You are right, man!
others
Traceback (most recent call last):
File "C:\Users\文博\Desktop\Test.py", line 14, in <module>
thisIsLove = eval(input())
File "<string>", line 1, in <module>
NameError: name 'others' is not defined
>>>
==================== RESTART: C:\Users\文博\Desktop\Test.py ====================
Who do you think I am?
bad guy
No!I cannot agree with you! |
|