-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathQuestion 24.py
36 lines (26 loc) · 909 Bytes
/
Question 24.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Python has many built-in functions, and if you do not know how to use it, you can read document
# online or find some books. But Python has a built-in document function for every built-in functions.
# Please write a program to print some Python built-in functions documents, such as abs(), int(), raw_input()
# And add document for your own function
#MY SOLUTION:
#Printing built-in Python function docs.
print(abs.__doc__)
print(int.__doc__)
print(input.__doc__)
#Printing my own function docs.
def random_function():
"Random function I'm creating to show how viewing documemnts works"
pass
print(random_function.__doc__)
#COURSE SOLUTION:
print(str.__doc__)
print(sorted.__doc__)
def pow(n,p):
'''
param n: This is any integer number
param p: This is power over n
return: n to the power p = n^p
'''
return n**p
print(pow(3,4))
print(pow.__doc__)