-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathage.py
executable file
·33 lines (27 loc) · 883 Bytes
/
age.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
try:
age = int(input("Enter your age:"))
if age >= 17:
print("you are an Adult ")
else:
print("you aren't an Adult")
except:
print("Enter an integer")
exit(1)
# finding the maximum value. Use max() function
max(22, 55, 666, 211125436, 88451485, 3, 5, 5455, 846, 55, 5645, 55, 4, 5555441854)
# finding the minimum value. Use min() function
min(2222524542656, 65252, 552, 522, 245522521452, 2525212, 4321, 5, 2, 0)
# to convert text to uppercase, use .upper() function
print("bang the door!!".upper())
# for replacing a string or an integer use replace() function
m = "time dood"
print(m.replace("dood", "pass"))
# for reversing a string use .reverse() function
# f = "this is a ball"
# f.reverse()
# for loops
for i in range(10):
for j in range(i, 10):
print("[" + str(i) + "|" + str(j) + "]", end="\t")
print("")
print("\n")