Skip to content

Commit 47fd711

Browse files
committed
first commit
0 parents  commit 47fd711

File tree

4 files changed

+33
-0
lines changed

4 files changed

+33
-0
lines changed

checkItemInList.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
healthy = ['pizza', 'frozen custard', 'apple crisp']
2+
3+
# print("chicken pot pie" in healthy)
4+
5+
# if "pizza" in healthy:
6+
# print("Eating the pizza!")
7+
8+
# if "broccoli" in healthy:
9+
# print("Eat it!!")
10+
11+
if "broccoli" not in healthy:
12+
print('Buying some.....')

listRoughly.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
healthy = ['pizza', 'frozen custard'] #list are an object actually
2+
3+
healthy.append('apple crisp') #append is a method
4+
5+
lengthOfTheList = len(healthy) #len is a standalone function
6+
7+
print("length: ", lengthOfTheList) #print is also a function

ritual.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
print('Hello, damn world!!')

stillWorkingWithList.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
healthy = ['kale chips', 'broccoli']
2+
backpack = ['pizza', 'frozen custard', 'apple crisp', 'kale chips']
3+
4+
# backpack.remove('pizza') # stupid way
5+
6+
# smarter way
7+
if "pizza" not in healthy:
8+
backpack.remove('pizza')
9+
10+
if "kale chips" not in healthy:
11+
backpack.remove('kale chips')
12+
13+
print(backpack)

0 commit comments

Comments
 (0)