-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNumbers.py
More file actions
29 lines (20 loc) · 1009 Bytes
/
Copy pathNumbers.py
File metadata and controls
29 lines (20 loc) · 1009 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
""" _______________________________ """
#!""" Numbers """
""" to convert the number to string use { str(number) } --> Because you can't print number with string!!"""
print("I'm " + str(24) + " years old.") #* The output is I'm 24 years old.
""" to take tha absolute value use { abs(number) } """
print(abs(-100.2)) #* The output is 100.2
""" power use { pow(a,b) } --> a^b """
print(pow(2,3)) #* The output is 8
""" to return the minimum value use { min(a,b,...)} """
print(min(2,5,3)) #* The output is 2
""" to return the maximum value use { max(a,b,...)} """
print(max(2,5,3)) #* The output is 5
""" round the number to the nearest whole number"""
print(round(3.43)) #* The output is 3
print(round(-3.76)) #* The output is -4
""" to convert the string to integer number use { int(string) } """
print(int("30")) #* The output is 30
""" to convert the string to float number use { float(string) } """
print(float("30")) #* The output is 30.0
""" _______________________________ """