6. Getting Input From Users - tomaslt99/Python-language-tutorials GitHub Wiki
Code:
# max - function, returns a bigger number.
print(max(3, 2))
Output:
3
Code:
# min - function, returns a smaller number
print(max(3, 2))
Output:
2
Code:
# round -function, Rounds a number
print(max(3, 2))
Output:
3
Code:
# floor function, takes the lowest number.
from math import *
print(floor(3.6))
Output:
3
Code:
# floor function, takes the lowest number.
from math import *
print(ceil(3.6))
Output:
4
Code:
# from math import * - take the square root.
from math import *
print(sqrt(36))
Output:
6.0
Code:
# Getting Input From Users.
variable_name = input("Enter your name:")
age = input("Enter your age:")
print("Hello," + variable_name + "!"" You are " + age)
Output:
Hello,
Hello,"text you entered"! You are "number you entered"