-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquestion24.py
More file actions
30 lines (21 loc) · 757 Bytes
/
question24.py
File metadata and controls
30 lines (21 loc) · 757 Bytes
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
'''
Question 24
Level 1
Question:
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
Hints:
The built-in document method is __doc__
'''
print(input.__doc__) # default doc for input method
def square(num):
'''
:param num: number to be squared
:return: squared integer value
Return the square value of the input number.
Input number must be an integer.
'''
return num ** 2
print(square(2))
print(square.__doc__)