python - After the first phone() why doesn't the it work? -


print("what type of device have phone, tablet or laptop(put brackets @      end of answer)?")  answer = input ("press enter , type in answer. phone(), tablet() or            console()")  def phone():     import webbrowser     print("do have iphone or samsung?")     answer = input ('iphone/samsung:')     if answer == "iphone":     print("what type of iphone?")     answer = input ('5, 6 or 7:')     if answer == "samsung":     print("what type of samsung have?")      answer = input ('s5, s6 or s7:') 

indent block, more careful!

def phone():     import webbrowser     print("do have iphone or samsung?")     answer = input ('iphone/samsung:')     if answer == "iphone":         print("what type of iphone?")         answer = input ('5, 6 or 7:')     if answer == "samsung":         print("what type of samsung have?")         answer = input ('s5, s6 or s7:') x = input("press enter , type in answer. phone(), tablet() or console() ") if x == 'phone()':     phone() elif x == 'tablet()':     tablet() elif x == 'console()':     console() 

Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -