+ 1
What are tabs in python?
I've looked everywhere and can't figure that out.
9 odpowiedzi
+ 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