Simple Operations | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

Simple Operations

Very dumb question, but I can't get simple math operations to output anything in code playground. Simply entering (4 + 8) / 2 returns >No output. Edit: nvm you need to include it in a print() command

10th Dec 2019, 7:26 PM
del46 _
del46 _ - avatar
5 Answers
+ 1
You must insert your math operations inside print() function, or assign it to a variable and print the resulting variable. That is necessary because code playground is not a REPL, it's the same as writing a Python script.
10th Dec 2019, 7:38 PM
Gonçalo Magalhaes
Gonçalo Magalhaes - avatar
0
Do (4+8/2)
11th Nov 2020, 1:14 AM
Navreet Gill
Navreet Gill - avatar
0
Write all the print statements or math operations to print inside function print()
31st Jan 2021, 6:02 PM
Jishu Yadav
2nd Feb 2021, 5:27 PM
Wirode Choiuylak
Wirode Choiuylak - avatar
0
Print((8+4)/2)
5th Mar 2021, 3:36 PM
Zakaria Atoui
Zakaria Atoui - avatar