+ 1
What are tabs in python?
I've looked everywhere and can't figure that out.
9 Antworten
+ 3
matt there are so many problems in the code, I think I would agree with Markus Kaleton suggestion for you to continue learning the lesson first. So far, these are what I've found:
- You use slanted single & double quotes, this should be changed to standard single & double quotes.
- You put colon after elif, this isn't right, colon should be at the end.
- All your code are aligned on the same level, you need to understand the concept of code indentation, it's crucial in Python.
So there, the things you need to put some fixing time into, don't fall back now, keep moving on : )
+ 2
matt save your code in your profile, and attach its URL in your question's Description section.
In case you don't know yet how; open your code in Code Playground editor, you'll see a share button up to the top right side, tap on it, and pick a menu that suggests to copy to clipboard. Next, edit your question, and paste it in Description section.
+ 1
Hello matt can you please tell more about it, like where you saw it, is it in the lesson's chapter, how it is phrased in the sentence, it's kinda difficult to answer because 'tabs' is a contextual word : )
+ 1
my code wasn't working so I asked how to make it work than the person told me that I need a tab
+ 1
ok but my code isn't working it still it gives an error sign
+ 1
I'll post the error sign and code
+ 1
I'll post it here
+ 1
while true:
print(âOptions:â)
print(âEnter âaddâ to add two numbers togetherâ)
print(âEnter âsubstractâ to substract from a numberâ)
print(âEnter âmultiplyâ to multiply a numberâ)
print(âEnter âdivideâ to divide a numberâ)
print(âEnter âquitâ to quit the programâ)
if user.input == âquitâ:
break
elif: user.input == âaddâ:
num1 = float(input(âEnter a number:â))
num2 = float(input(âEnter another number:â))
result = str(num1 + num2)
print (âthe answer is â + result)
elif: user.input == âsubstractâ:
num1 = float(input(âEnter a number:â))
num2 = float(input(âEnter another number:â))
result = str(num1 - num2)
print (âthe answer is â + result)
elif: user.input == âmultiplyâ:
num1 = float(input(âEnter a number:â))
num2 = float(input(âEnter another number:â))
result = str(num1 * num2)
print (âthe answer is â + result)
elif: user.input == âdivideâ:
num1 = float(input(âEnter a number:â))
num2 = float(input(âEnter another number:â))
result = str(num1 / num2)
print (âthe answer is â + result)
+ 1
There is so much wrong with the code that i highly recommend you take the python lesson here on sololearn