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
Post a Comment