⊗pyPmIBMP 172 of 208 menu

Power and Root in Python

math.pow math.sqrt

Two numbers are given:

num1 = 5 num2 = 4

Raise the first number to the power of the second.

Given a dictionary:

dct = { 2: 4, 3: 2, 5: 4 }

Raise each key to the power of the value to get the following result:

16.0 9.0 625.0

Given a number:

num = 16

Find the square root of this number.

Given a list:

lst = [2, 3, 4]

Find the square root of the sum of the numbers in the given list.

byenru