2013-10-21 62 views
1

我是編程新手,我試圖製作一個python程序。那就是:Python程序錯誤

import time 
gravity = 0 
space = 0 

print "Welcome to the 'Find out who is in space' program" 

person_messy = raw_input("Enter a name:") 

person = person_messy.lower() 

if len(person) < 5: 
    print "Make sure you put the first AND last name" 
else: 
    space = 1 
    print "Searching database....." 

if person == "oleg kotov" or "mike hopkins" or "sergey ryazanskiy" or "fyodor yurchikhin" or "karen nyberg" or "luca permitano": 
    gravity = 1 
else: 
    gravity = 0 

time.sleep(1) 

if space == 1: 
    print "loading..." 

time.sleep(1) 

if space == 1: 
    print "loading..." 

time.sleep(1) 

if space == 1: 
    print "loading..." 

if gravity == 1: 
    print person + "is in space!" 
else: 
    print "You and " + person + "are on the same planet." 

這是我得到的錯誤:

Internal error: ReferenceError: _select is not defined

+2

您是否正在使用在線Python解釋器? – DSM

+2

究竟是什麼時候出現錯誤? – BergQuester

+0

你能描述你的環境嗎?這不是正常的行爲。 –

回答

0

我有類似的代碼,同樣的問題。你不能用time.sleep也給出了這樣的。我不知道爲什麼,但修復了我的代碼(不使用time.sleep)