Skip to primary content
Skip to secondary content

Coding Stream of Consciousness

by John Humphreys – Random code from my life.

Coding Stream of Consciousness

Main menu

  • Blog Posts
  • About Me
  • Linked In : Follow Me
  • Stack Overflow
  • MapR Forum
  • Conferences
  • Contact

Tag Archives: exponents

Python – Math – Exponents / Powers

Posted on November 6, 2018 by John Humphreys
Reply

There is actually a direct operator to calculate exponents in python; you don’t need to use any math libraries/etc.

For example:

#Calculate 4 squared.
4 ** 2
16

#Calculate 2 cubed.
2 ** 3
8
Posted in python | Tagged exponents, python | Leave a reply

Archives

  • May 2023
  • December 2022
  • November 2022
  • September 2022
  • January 2022
  • November 2021
  • September 2021
  • August 2021
  • January 2021
  • December 2020
  • October 2020
  • September 2020
  • July 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • January 2020
  • December 2019
  • November 2019
  • October 2019
  • August 2019
  • July 2019
  • June 2019
  • May 2019
  • April 2019
  • March 2019
  • February 2019
  • January 2019
  • December 2018
  • November 2018
  • September 2018

Meta

  • Register
  • Log in
Blog at WordPress.com.
  • Follow Following
    • Coding Stream of Consciousness
    • Join 35 other followers
    • Already have a WordPress.com account? Log in now.
    • Coding Stream of Consciousness
    • Customize
    • Follow Following
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar