Skip to content

Commit 48fbede

Browse files
committed
Exam prep
1 parent 0e425c5 commit 48fbede

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
3+
sold_yesterday = 100
4+
sold_today = 20
5+
6+
if sold_yesterday > sold_today:
7+
sales_trend = -1
8+
9+
else:
10+
sales_trend = 1
11+
12+
print(sales_trend)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
my_string = "programming"
3+
4+
print(my_string[0:4])
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
sentence = "Broccoli is delicious."
2+
words = sentence.split() # Split the sentence into a list of words
3+
secondWord = words[1] # Access the second word (index 1)
4+
5+
print(secondWord) # Output: is
6+

0 commit comments

Comments
 (0)