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

Simple Operations

In the description they put 2+2 And the output is 4 but I don't get it am I supposed to only put the numbers or more than that cuz it DOSENT work for me

26th Jan 2020, 7:28 AM
sanees
sanees - avatar
56 Answers
+ 7
Python: print(2+2) Output 4 C: printf(2+2) Output 4 C++: cout<<2+2; Output 4
1st Dec 2020, 3:59 PM
Hamza Khan
Hamza Khan - avatar
+ 6
1) if you just do just 2+2 python will just do calculations and will not show the result be ause you didn't ask to show . 2)You have to ask the python to show this result by the help of print and parenthesis means () these brackets 3) Like Example :- print(2+2) Like that python interpreter will know that it have to show that result in output window
8th Dec 2020, 10:17 AM
Sayyam Jain
Sayyam Jain - avatar
+ 3
Python: print(2+2) C++: cout << 2+2;
26th Jan 2020, 7:30 AM
🍇 Alex Tușinean 💜
🍇 Alex Tușinean 💜 - avatar
+ 2
Maybe you edit the Comment sanees but in python there are 3 data type integer , string and float you can some operations on them also
11th Dec 2020, 4:26 AM
Sayyam Jain
Sayyam Jain - avatar
+ 1
Python: print(2+2)
11th Nov 2020, 7:31 AM
ojasvi bhardwaj
ojasvi bhardwaj - avatar
+ 1
Python :print(2+2)
3rd Jan 2021, 10:31 AM
Charos Do'stmurodova
Charos Do'stmurodova - avatar
+ 1
For python write print(2+2) and get output 4
1st Jun 2021, 11:29 AM
gagan Sharma
0
Yep, only numbers so keep away from using double quotations
26th Jan 2020, 7:46 AM
Luqman Hakim
Luqman Hakim - avatar
0
ruby : puts 2+2 output 4 puts "2+2" output 2+2
26th Jan 2020, 5:00 PM
alfian
alfian - avatar
0
In python, space is key! So it would be print(2 + 2)
13th Nov 2020, 1:47 PM
Siri
0
Python: print(2+2)
14th Nov 2020, 9:48 PM
Joel Martinez
Joel Martinez - avatar
0
Python: Lets calculate the number 2+2
15th Nov 2020, 1:55 PM
DHAWNEET GEHLOT
DHAWNEET GEHLOT - avatar
0
Python: print(2+2)
17th Nov 2020, 8:19 AM
Dipanshu Kumar
Dipanshu Kumar - avatar
0
print(2+2) output-4
23rd Nov 2020, 10:48 AM
Shakti Agarwal
0
We can write that in so many ways Here are some examples 😉 a=2+2 print(a) Another one .... print(2+2) can also give you the answer
25th Nov 2020, 1:46 AM
Nobita
0
Print ('2+2')
28th Nov 2020, 8:58 PM
Mohamed Daoud
Mohamed Daoud - avatar
0
print(2+2)
29th Nov 2020, 5:49 PM
Egorwolv
0
22
2nd Dec 2020, 6:12 AM
Om Tripathi
0
Print (1(2)+1(2)) output-4
6th Dec 2020, 10:13 AM
Varutharaj
0
Your have to write: print(2+2)
7th Dec 2020, 11:43 AM
Vikram Singh Slathia
Vikram Singh Slathia - avatar