Phyton challenge | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5

Phyton challenge

What is the output of this code? a = abs(-87) a=(a+3)%8; print(a) Can anyone explain about this?

14th Mar 2021, 11:03 AM
M Meidi
M Meidi - avatar
49 Answers
+ 25
Meehzam I'm sure you already know this, but Python is a snake and the name of a programming language. Phyton is of course the Suel god of Nature, Beauty, and Farming, whose symbol is a scimitar in front of an oak tree. 🤣
14th Mar 2021, 12:04 PM
David Ashton
David Ashton - avatar
+ 11
Abs of -87 is 87 a=87 a+3= 90 90%8 = 2
14th Mar 2021, 11:13 AM
Sâgærāvürï
Sâgærāvürï - avatar
+ 11
Now this is really starting to drive me crazy 😜 Why are so many people (not to mention any names Jasurbek Abdijalilov Sobirjon o'g'li Alexander Genereaux Techno Reda ) posting the same answer hours and hours and hours after someone else already posted it? 🤔 Don't get me wrong - it's great that you are participating and helping! Just strange that you didn't see the other posts.... Did you think the request for help was a coding challenge? P.S. if you really want to help, rather than just posting the output of the code, also give an explanation, which was asked for 🙂
15th Mar 2021, 11:18 PM
David Ashton
David Ashton - avatar
+ 10
David Ashton The sad truth: For some, it is more important to show that they know the answer than to help the questioner. Sometimes we should hold back our own ego a little.
15th Mar 2021, 7:41 PM
Crash
Crash - avatar
+ 9
Why are so many people (not to mention any names Reda Pankaj Kumar Ray saimanasa bandaru Rohith Jakkani ) posting the same answer hours and hours after someone else already posted it? 🤔 Don't get me wrong - it's great that you are participating and helping! Just strange that you didn't see the other posts.... P.S. if you really want to help, rather than just posting the output of the code, also give an explanation, which was asked for 🙂
15th Mar 2021, 7:14 PM
David Ashton
David Ashton - avatar
+ 6
Giovanni Reale you, too, get 10/10 for good intentions but 2/10 for powers of observation since the answer 2 was posted 12 hours before you did 🤣
15th Mar 2021, 1:45 AM
David Ashton
David Ashton - avatar
+ 6
Inglés: Absolute of -87 is 87. So a=87 a=(87+3)%8 a= 90%8 8*11=88. 90-88=2=a a=2 Español: Valor absoluto de -87 es 87. Entonces a=87 a=(87+3)%8 a= 90%8 8*11=88. 90-88=2=a a=2
15th Mar 2021, 4:19 PM
Emerson Rueda
Emerson Rueda - avatar
+ 5
14th Mar 2021, 11:09 AM
Sâgærāvürï
Sâgærāvürï - avatar
+ 4
Can you explain it with the simple and understandable way? 🙂
14th Mar 2021, 11:11 AM
M Meidi
M Meidi - avatar
+ 4
Oh I think I get it, what is the meaning of this abs?
14th Mar 2021, 11:16 AM
M Meidi
M Meidi - avatar
+ 4
Absolute value
14th Mar 2021, 11:17 AM
Sâgærāvürï
Sâgærāvürï - avatar
+ 4
Some people say that abs are the muscles near your waist but I get no Google results for Phyton.
15th Mar 2021, 4:32 AM
Sonic
Sonic - avatar
+ 4
a = abs(-87) => 87 a=(a+3)%8; => 87+3 =90 print(a) => 90%8 = 2 ---------------------
15th Mar 2021, 5:57 PM
‎Emad Esmail ‎
‎Emad Esmail ‎ - avatar
+ 4
I guess that from this point it's just spam...
16th Mar 2021, 5:20 AM
Sonic
Sonic - avatar
+ 3
2
14th Mar 2021, 11:12 PM
Giovanni Reale
Giovanni Reale - avatar
+ 3
Abs means that you negative number will turns positive. Then add the a value with 3. Then computer will find the a value remainder
15th Mar 2021, 4:05 AM
Wijdan Insania Kuncoro
Wijdan Insania Kuncoro - avatar
+ 3
a = abs(-87) #a=87 a=(a+3)%8; #a=(87+3)%8=90%8=2 print(a) # the printed value is 2
15th Mar 2021, 10:59 AM
Riahi Firas
Riahi Firas - avatar
+ 3
Btw thanks all for the information you gave 😊
16th Mar 2021, 8:28 AM
M Meidi
M Meidi - avatar
+ 3
|-87| = 87 87 + 3 = 90 90/8 --> remainder = 2
12th Sep 2023, 11:31 AM
Piyush Chaudhary
Piyush Chaudhary - avatar
+ 2
Ohh okayy thanks for the information 😊
14th Mar 2021, 11:18 AM
M Meidi
M Meidi - avatar