+ 2

[DUPLICATE] 📝 What does ** means ?

Just a quick question about something in Python, which often occurs in my Challenges, but I've never seen that before. a = 3 b = 7 print(a**b) >> 2187 I don't understand what is ** , and why it gives the result 2187, if someone could explain to me please 🙂✹

29th Jan 2018, 3:11 PM
Jin 🌙
Jin 🌙 - avatar
4 Answers
+ 15
** in python or ruby means ^ in math ie 3**7 = 3^7 = 3.3.3.3...7times =2187
29th Jan 2018, 3:44 PM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 4
3**7 is 3^7 or 3x3x3x3x3x3x3 which is 2187
29th Jan 2018, 3:43 PM
Ice
Ice - avatar
+ 4
Its equivalent to the carot key (^). Used to create exponents.
29th Jan 2018, 6:01 PM
Bryan
Bryan - avatar
+ 2
Aw, thank you all đŸ’«
30th Jan 2018, 10:23 AM
Jin 🌙
Jin 🌙 - avatar