feat: created several scratch example files for loops and conditionals

This commit is contained in:
baphim
2026-09-30 14:34:44 -04:00
parent 1e740c7ff8
commit 605ab16b9c
3 changed files with 81 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
# Comparison operators: '==' equals, '!=' not equal, <, >, <=, >=, and, not
#
# Program moves top to bottom in order
#
# # Set age var
# age = 18
# # if age var is greater than or equal to 18, print string
# if age >= 18:
# print('You are an adult')
# # else, if age is greater than or equal to 13, print string (fires if conditional above it is not true)
# elif age >= 13:
# print('You are a teen')
# # Else (age is not greater than or equal to 13 or 18) print string (Fires if none of other conditionals are true)
# else:
# print('You are a child')
# Same structure, triggering elif conditional and adds formatted string
score = 72
if score >= 90:
print('A grade')
elif score >= 80 and score <90:
print('B grade')
else:
print(f'Your score of {score} needs improvement')