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?

26th Jun 2020, 12:45 PM
xionixx
xionixx - avatar
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
26th Jun 2020, 1:01 PM
Ali Abdelhady
Ali Abdelhady - avatar
+ 1
Unfortunately, inputs do not work properly in Sublime Text
26th Jun 2020, 12:49 PM
Ali Abdelhady
Ali Abdelhady - avatar
+ 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
26th Jun 2020, 1:08 PM
Suhail KM
0
What i need to use besides Sublime?
26th Jun 2020, 12:53 PM
xionixx
xionixx - avatar
0
xionixx You can use any other editor or even the Python shell, go for Visual Studio Code it is not bad at all!
26th Jun 2020, 12:54 PM
Ali Abdelhady
Ali Abdelhady - avatar
0
If i use any compiler it doesn't work
26th Jun 2020, 12:58 PM
xionixx
xionixx - avatar
0
Thx,i fix that.
26th Jun 2020, 1:09 PM
xionixx
xionixx - avatar