+ 2
What is the syntax for basic math
I cannot do basic math in my playground as it is said in the lesson. It says I have the wrong syntax
10 Answers
+ 6
If you type
3 + 4
and hit Run you will get a syntax error.
If you type
print(3 + 4)
and hit Run you will get 7
+ 3
Don't use ">>>" in the playground.
">>>" means an executable line on console.
Console is a programming tool, which let you run statements by pressing enter.
+ 2
It works thank you both
+ 1
This is in python
+ 1
Can you post your code?
+ 1
Use the eval function.
Example:
print(eval(1+1))
2
print(eval(5+6-4))
7
+ 1
In your code, if you change line 1 from
>>> 2+2
to
result = 2+2
it will work too đ
0
You might want to make your own question board thing. There is also a lesson on it somewhere I will tell you when I find it
0
I found a couple lessons on interviewing and stuff you could look at