How is the output different? | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
+ 1

How is the output different?

#I know in maths a⁰ = 1, but the first line is same as the second one, isn't it? How is the output different? print(0**0) output: 1 print(0*0) output: 0

17th Oct 2022, 2:17 PM
Shantanu
Shantanu - avatar
8 ответов
+ 2
Oh. Is it not solved? You said typo mistake? Do you mean why not 0,0 ? As you mentioned already a°= 1 so 0**0 is 0° => 1 And 0 * 0 is 0 as you know a * 0 => 0 Do you mean, why not 1,1 ? Still same answer. a° = 1 so 0° => 0**0 = 1 1**0 => 1, .. 999**0 => 1 And a * 0 => 0*0 = 0. 1234*0 => 0 Anything power of 0 => 1 Anything multiplied by 0 is 0 Mathematics basics... Hope it clears...
17th Oct 2022, 3:27 PM
Jayakrishna 🇮🇳
+ 2
* and ** are different operators. That's all.
17th Oct 2022, 5:23 PM
Oma Falk
Oma Falk - avatar
+ 1
Recheck again.. Can you share as code link ?
17th Oct 2022, 2:35 PM
Jayakrishna 🇮🇳
17th Oct 2022, 2:36 PM
Shantanu
Shantanu - avatar
+ 1
The answer am getting is 1 0 . Not 1 2 ..!
17th Oct 2022, 2:40 PM
Jayakrishna 🇮🇳
+ 1
Jayakrishna🇮🇳 , it was typing mistake.
17th Oct 2022, 3:02 PM
Shantanu
Shantanu - avatar
+ 1
Jayakrishna🇮🇳 , can you please explain me what I'm asking?
17th Oct 2022, 3:07 PM
Shantanu
Shantanu - avatar