0
Why it doesn't work at sublime text?
I wrote simple code by Python in SublimeText.My code looks like code in SoloLearn course about calculator. My code: while True: print("Options:") print("plus") print("quit") user = input("Select Func: ") if user == "quit" : exit = input("Are you sure? y/n: ") if exit == "y": break else: print("Aborted") if user == "plus" : num1 = float(input("Write First number: ")) num2 = float(input("Write Second number: ")) result1 = str(num1 + num2) print(result1) when i use "elif" it's makes syntax error,when i use if,happens nothing.If i use code from SoloLearn course it doesn't work.Whats wrong?
7 Antworten
+ 1
xionixx Make sure your indentation is correct, groups of if, elif and else should be on the same indentation level if you are specifying different conditions for the value of "user" variable
the last if should be an elif and on the same indentation level as the first if
+ 1
Unfortunately, inputs do not work properly in Sublime Text
+ 1
You can use notepad++ if you have low spec u just need to configure notepad++ to lauch interpreter to run the code on the text
0
What i need to use besides Sublime?
0
If i use any compiler it doesn't work
0
Thx,i fix that.