我想知道是否有一個命令,這將有助於我去一個特定的行並跳過其他線路,類似如下:如何跳入Python中的行?
if [x] in database1: (the command I need)
skipping other lines.......
to go here:
if [x] in database1: print ' Thank you ' + name + ' :)\n' <<<< which is in line 31
編輯:添加代碼pastebin
print ' Note: Write your Name and Surname with the first leter, BIG !'
print ' ...'
name = raw_input('Name: ')
surname = raw_input('Surname: ')
print name + ' ' + surname + ',' + ' The Great !\n'
print ' Did you like this ?'
x = raw_input('Yes/No : ')
print ''
database = [
['No'],
['no']
]
database1 = [
['Yes'],
['yes']
]
if [x] in database: print ' Did you really meant that ?'
if [x] in database: y = raw_input('Yes/No : ')
# (I need the command here to go that line :)
if [y] in database1: print ' So you'll be dead ' + name + ' !\n'
if [y] in database: print ' Oh OK, Than your free to go ' + name + ' :)'
if [x] in database1: print ' Thank you ' + name + ' :)\n'
if [x] in database1: print 'Try (No) next time !\n'
你能告訴我爲什麼不應該使用它嗎? – Amir 2016-08-08 06:28:21
來自項目主頁:'「goto」模塊是2004年4月1日發佈的愚人節玩笑。是的,它可以工作,但這是一個笑話。請不要在真正的代碼中使用它' – 2016-09-04 19:10:43