1
0

initial file upload

This commit is contained in:
mlot
2025-05-09 10:12:44 -04:00
parent 61bf543133
commit 40e9918df0
22 changed files with 215 additions and 1 deletions

2
chap2/apostrophe.py Normal file
View File

@@ -0,0 +1,2 @@
message = "One of Python's strengths is its diverse community."
print(message)

2
chap2/comment.py Normal file
View File

@@ -0,0 +1,2 @@
# Say hello to everyone
print("Hello Python People!")

1
chap2/famous_quote.py Normal file
View File

@@ -0,0 +1 @@
print('Douglas Adams once said, "We are stuck with technology when what we really want is just stuff that works."')

3
chap2/famous_quote2.py Normal file
View File

@@ -0,0 +1,3 @@
famous_person = "Douglas Adams"
message = f'{famous_person} once said, "We are stuck with technology when what we really want is just stuff that works."'
print(message)

2
chap2/file_extensions.py Normal file
View File

@@ -0,0 +1,2 @@
filename = "python_notes.txt"
print(filename.removesuffix('.txt'))

15
chap2/full_name.py Normal file
View File

@@ -0,0 +1,15 @@
first_name = "ada"
last_name = "lovelace"
full_name = f"{first_name} {last_name}"
print(full_name)
first_name = "ada"
last_name = "lovelace"
full_name = f"{first_name} {last_name}"
print(f"Hello, {full_name.title()}!")
first_name = "ada"
last_name = "lovelace"
full_name = f"{first_name} {last_name}"
message = f"Hello, {full_name.title()}!"
print(message)

12
chap2/hello_world.py Normal file
View File

@@ -0,0 +1,12 @@
message = "Hello Python World!"
print(message)
mesage = "Hello Python Crash Course World!"
print(mesage)
# Try It Yourself pg. 19
message_alert1 = "This is a test of the emergency broadcast system."
print(message_alert1)
message_alert1 = "This is only a test."
print(message_alert1)

6
chap2/name.py Normal file
View File

@@ -0,0 +1,6 @@
name = "ada lovelace"
print(name.title())
name = "Ada Lovelace"
print(name.upper())
print(name.lower())

6
chap2/name_cases.py Normal file
View File

@@ -0,0 +1,6 @@
# This program takes the name assigned to a variable and prints it out in upper, lower, and title cases
first_name = "Barb"
print(first_name.upper())
print(first_name.lower())
print(first_name.title())

7
chap2/numbers.py Normal file
View File

@@ -0,0 +1,7 @@
print(2*4)
print(16/2)
print(9-1)
print(5+3)
my_fav_num = 7
print(f"My favorite number is {my_fav_num}")

View File

@@ -0,0 +1,4 @@
# This program assigns the name Ted to a variable and includes in a formatted print to stout
first_name = "Ted"
print(f"Hello {first_name}, would you like to learn some Python today?")

7
chap2/stripping_names.py Normal file
View File

@@ -0,0 +1,7 @@
persons_name = " Douglas Adams "
print(persons_name)
print(persons_name.lstrip())
print(persons_name.rstrip())
print(persons_name.strip())
print(f"{persons_name}\n")
print(f"\t{persons_name}")