-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1.py
More file actions
31 lines (23 loc) · 685 Bytes
/
1.py
File metadata and controls
31 lines (23 loc) · 685 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
def hello_world():
print("Hello, World!")
hello_world()
def calculate_vat(amount):
return print(amount * 1.2)
calculate_vat(100)
def changeString(string):
print(string.upper())
print(string.lower())
first_letter = string[0].lower()
last_letter = string[-1].lower()
print(first_letter == last_letter)
print(string.lower().replace(first_letter,"[REDACTED]"))
changeString("abcd")
input_str = "practice"
print(input_str[4::-2])
def removeFirstAndLastCharacter(str):
str = str[1:]
str = str[:-1]
return print(str)
removeFirstAndLastCharacter("abcd")
students = ["Chloe", "Anna", "Lauren", "Shreya", "Siobhan"]
print(sorted(students)[0])