We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8fe6f4a commit 50c9237Copy full SHA for 50c9237
Fun with Numbers/Power, cube and square.py
@@ -0,0 +1,29 @@
1
+# SQUARE
2
+def squarenum():
3
+ x = float(input("Enter a number: "))
4
+ print("The square is ",square(x))
5
+
6
+def square(n):
7
+ return n * n
8
9
+# CUBE
10
+def cubenum():
11
12
+ print("The cube is ",cube(x))
13
14
+def cube(n):
15
+ return n * n * n
16
17
+#Power
18
+def powernum():
19
20
+ y = float(input("Enter a exponent: "))
21
+ print("The power is ",power(x,y))
22
23
+def power(x,y):
24
+ return pow(x,y)
25
26
+# Now using are own function
27
+squarenum()
28
+cubenum()
29
+powernum()
0 commit comments