Skip to content
Open

test #31

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
3098bac
Update SQL-Part-1-Exercises.ipynb
nohanlon3254 Oct 8, 2025
a994549
Update SQL-Part-2-Studio.ipynb
nohanlon3254 Oct 9, 2025
4aa0dfa
Update SQL-Part-2-Studio.ipynb
nohanlon3254 Oct 9, 2025
1a53d0d
Update SQL-Part-2-Studio.ipynb
nohanlon3254 Oct 9, 2025
b2722eb
Most Recent
nohanlon3254 Oct 10, 2025
48d2453
Uploadi to Git
nohanlon3254 Oct 10, 2025
56f2ec8
4
nohanlon3254 Oct 15, 2025
c866f3a
Upload 2025.10.14
nohanlon3254 Oct 15, 2025
386bcdd
Uploading SQL-Part-2-Studio.ipynb
nohanlon3254 Oct 15, 2025
28c3801
CCommit
nohanlon3254 Oct 15, 2025
37fca0e
Merge branch 'sql-part-2'
nohanlon3254 Oct 15, 2025
7cb7c01
10.16.2025
nohanlon3254 Oct 16, 2025
4c72640
Update SQL-Part-3-Studio.ipynb
nohanlon3254 Oct 16, 2025
032b389
15.50
nohanlon3254 Oct 16, 2025
a48c553
15.52
nohanlon3254 Oct 16, 2025
32aaa39
Merge branch 'main' of https://github.com/nohanlon3254/data-analysis-…
nohanlon3254 Oct 16, 2025
dde1fca
Update SQL-Part-3-Studio.ipynb
nohanlon3254 Oct 17, 2025
c78e242
10/18/2025 14:22:10 -0700
nohanlon3254 Oct 18, 2025
03254e8
10212025 2006
nohanlon3254 Oct 22, 2025
5b91683
10212025 2006
nohanlon3254 Oct 22, 2025
5d4ecbd
10212025 2008
nohanlon3254 Oct 22, 2025
cc20120
Update SQL-Part-4-Studio.ipynb
nohanlon3254 Oct 22, 2025
ae8babc
Update SQL-Part-4-Studio.ipynb
nohanlon3254 Oct 22, 2025
d290b9c
10232025 1945
nohanlon3254 Oct 24, 2025
50dde99
Merge branch 'main' of https://github.com/nohanlon3254/data-analysis-…
nohanlon3254 Oct 24, 2025
ec88d08
10/2/2025
nohanlon3254 Oct 30, 2025
891fe41
11022025
nohanlon3254 Nov 2, 2025
bf79e76
11.06.2025
nohanlon3254 Nov 7, 2025
f1bd546
11/11/2025
nohanlon3254 Nov 12, 2025
00bb752
11/13/2025
nohanlon3254 Nov 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.DS_Store
.ipynb_checkpoints
venv/
sql-part-2/studio/SQL Class 1 Studio.sql
7 changes: 6 additions & 1 deletion booleans-and-conditionals/exercises01.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Assign the variables for exercise 1 here:

engine_indicator_light="red blinking"
space_suits_on=True
shuttle_cabin_ready=True
crew_status=space_suits_on and shuttle_cabin_ready
computer_status_code=200
shuttle_speed=15000


# BEFORE running the code, predict what will be printed to the console by the following statements:
Expand Down
20 changes: 17 additions & 3 deletions booleans-and-conditionals/exercises02.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,28 @@
# 3) Write conditional expressions to satisfy the following safety rules:

# a) If crew_status is true, print "Crew Ready" else print "Crew Not Ready".

if crew_status = True
print("Crew Ready")
else:
print("Crew Not Ready")

# b) If computer_status_code is 200, print "Please stand by. Computer is rebooting." Else if computer_status_code is 400, print "Success! Computer online." Else print "ALERT: Computer offline!"

if computer_status_code == 200:
print("Please stand by. Computer is rebooting.")
elif computer_status_code == 400:
print("Success! Computer online.")
else:
print("ALERT: Computer offline!")

# c) If shuttle_speed is > 17,500, print "ALERT: Escape velocity reached!" Else if shuttle_speed is < 8000, print "ALERT: Cannot maintain orbit!" Else print "Stable speed".

if shuttle_speed > 17500:
print("ALERT: Escape velocity reached!")
elif shuttle_speed < 8000:
print("ALERT: Cannot maintain orbit!")
else:
print("Stable speed.")

# 4) PREDICT: Do the code blocks shown in the Section D produce the same result?

# print("Yes" or "No")
print("No")
29 changes: 24 additions & 5 deletions booleans-and-conditionals/exercises03.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

# a) If fuel_level is above 20000 AND engine_temperature is at or below 2500, print "Full tank. Engines good."


# b) If fuel_level is above 10000 AND engine_temperature is at or below 2500, print "Fuel level above 50%. Engines good."

# c) If fuel_level is above 5000 AND engine_temperature is at or below 2500, print "Fuel level above 25%. Engines good."
Expand All @@ -18,13 +19,31 @@
# f) Otherwise, print "Fuel and engine status pending..."

# Code 5a - 5f here:


if fuel_level < 1000 or engine_temperature > 3500 or engine_indicator_light == "red blinking":
print("ENGINE FAILURE IMMINENT!")
elif fuel_level <= 5000 or engine_temperature > 2500:
print("Check fuel level. Engines running hot.")
elif fuel_level > 20000 and engine_temperature <= 2500:
print("Full tank. Engines good.")
elif fuel_level > 10000 and engine_temperature <= 2500:
print("Fuel level above 50%. Engines good.")
elif fuel_level > 5000 and engine_temperature <= 2500:
print("Fuel level above 25%. Engines good.")
else:
print("Fuel and engine status pending...")

# 6) a) Create the variable command_override, and set it to be true or false. If command_override is false, then the shuttle should only launch if the fuel and engine check are OK. If command_override is true, then the shuttle will launch regardless of the fuel and engine status.

command_override= False

# 6) b) Code the following if/else check:

if command_override:
print("Command override active: Launching shuttle regardless of system status.")
elif fuel_level and engine_indicator_light:
print("All Systems go: Launching shuttle.")
else:
print("Launch aborted:fuel or engine check failure")
# If fuel_level is above 20000 AND engine_indicator_light is NOT red blinking OR command_override is true print "Cleared to launch!" Else print "Launch scrubbed!"

if fuel_level > 20000 and engine_indicator_light != True or command_override ==True:
print("Cleared to launch")
else:
print("Launch Scrubbed")
26 changes: 22 additions & 4 deletions collections/studio/list-and-string-conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,36 @@
strings = [proto_list1, proto_list2, proto_list3, proto_list4]

# a) Use the 'in' method to check to see if the words in each string are separated by commas (,), semicolons (;) or just spaces.

string: str
for string in strings:
if "," in string:
print(f"{string} contains commas (,)")
elif ";" in string:
print(f"{string} contains semicolons")
elif " " in string:
print(f"{string} contains semicolon")
else:
print(f"error with {string}")

# b) If the string uses commas to separate the words, split it into an array, reverse the entries, and then join the array into a new comma separated string.



# c) If the string uses semicolons to separate the words, split it into an array, alphabetize the entries, and then join the array into a new comma separated string.

for string in strings:
if ";" in string:
parts = string.split(";")
alphabatized = list(sorted(parts))
new_string = ";".join(alphabatized)
print(f"new string: {new_string}")


# d) If the string uses spaces to separate the words, split it into an array, reverse alphabetize the entries, and then join the array into a new space separated string.


for string in strings:
if " " in string:
parts = string.split(" ")
alphabatized = list(reversed(parts))
new_string = " ".join(alphabatized)
print(f"new string: {new_string}")

# e) If the string uses ‘comma spaces’ to separate the list, modify your code to produce the same result as part “b”, making sure that the extra spaces are NOT part of the final string.
10 changes: 8 additions & 2 deletions collections/studio/string-modification.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,17 @@


# a) Use string methods to remove the first three characters from the string and add them to the end.

to_be_moved= my_string[0:3]
my_string=my_string[3:] + to_be_moved
print(my_string)


# Use a template literal to print the original and modified string in a descriptive phrase.

my_o_string='LaunchCode'
to_be_moved=my_string[0:3]
my_string=my_o_string[3:]+to_be_moved
print(my_string)
print(my_o_string)


# b) Modify your code to accept user input. Query the user to enter the number of letters that will be relocated.
Expand Down
19 changes: 16 additions & 3 deletions data-and-variables/exercises/exercises.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
# 1. Declare and assign the variables here:

shuttle_name = 'Determination'
shuttle_speed_mph = 17500
distance_to_mars_km = 225000000
distance_to_moon_km = 38400
MILES_PER_KM = 0.621
# 2. Use print() to print the 'type' each variable. Print one item per line.

print(type(shuttle_name))
print(type(shuttle_speed_mph))
print(type(distance_to_mars_km))
print(type(distance_to_moon_km))
# Code your solution to exercises 3 and 4 here:

miles_to_mars = distance_to_mars_km * MILES_PER_KM
hours_to_mars = miles_to_mars / shuttle_speed_mph
days_to_mars = hours_to_mars / 24
# Code your solution to exercise 5 here
miles_to_moon = distance_to_moon_km * MILES_PER_KM
hours_to_moon = miles_to_moon / shuttle_speed_mph
days_to_moon = hours_to_moon / 24
print(shuttle_name + " will take " + days_to_moon + " days to reach the Moon.")
42 changes: 40 additions & 2 deletions functions/exercises/functions-exercises.py
Original file line number Diff line number Diff line change
@@ -1,40 +1,78 @@
# Part 1 A -- Make a Line
make_line(size):
line = ""
for i in range(size):
line += "#"
return line

print(make_line(5))


# Part 1 B -- Make a Square
# create a function using your make_line function to code a square
def make_rectangle(width, height):
rectangle = ""
for i in range(height):
rectangle += (make_line(width) + "\n")
return rectangle

print(make_rectangle(5, 3))




# Part 1 C -- Make a Rectangle
def make_rectangle(width, height):
rectangle = ""
for i in range(height):
rectangle += (make_line(width) + "\n")
return rectangle

print(make_rectangle(5, 3))




# Part 2 A -- Make a Stairs
def make_downward_stairs(height):
stairs = ""
for i in range(height):
stairs += (make_line(i+1) + "\n")
return stairs

print(make_downward_stairs(5))




# Part 2 B -- Make Space-Line

print(make_space_line(3, 5));




# Part 2 C -- Make Isosceles Triangle
def make_isosceles_triangle(height):
triangle = ""
for i in range(height):
triangle += (make_space_line(height - i - 1, 2 * i + 1) + "\n")
return triangle

print(make_isosceles_triangle(5))




# Part 3 -- Make a Diamond

def make_diamond(height):
diamond = ""
triangle = make_isosceles_triangle(height)
diamond += triangle[:-1]
for i in range(len(triangle)-1, -1, -1):
diamond += triangle[i]
return diamond

print(make_diamond(5))



Expand Down
38 changes: 33 additions & 5 deletions functions/studio/functions-studio.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,50 @@
# We want to COMPLETELY reverse a list by flipping the order of the entries AND flipping the order of characters in each element.

# a) Define a 'reverse_characters' function. Give it one parameter, which will be the string to reverse.
def reverse_characters (word):
# b) Within the function, use the 'list' function to split a string into a list of individual characters
def reverse_characters(list)):
return chars = list(list))
# c) 'reverse' your new list.
def reverse_characters(list)):
chars = list(list))
return chars.reverse()
# d) Use 'join' to create the reversed string and return that string from the function.
# e) Create a variable of type string to test your new function. # f) Use 'print(reverse_characters(my_variable_name))'; to call the function and verify that it correctly reverses the characters in the string.
def reverse_characters(list)):
chars = list(list))
chars.reverse()
return "".join(chars)
# e) Create a variable of type string to test your new function.
my_variable_name = "Test"
# f) Use 'print(reverse_characters(my_variable_name))'; to call the function and verify that it correctly reverses the characters in the string.
print(reverse_characters(my_variable_name))
# g) Use method chaining to reduce the lines of code within the function.



# 2) The 'split' method does not work on numbers, but we want the function to return a number with all the digits reversed (e.g. 1234 converts to 4321 and NOT the string "4321")
# a) Add an if statement to your reverse_characters function to check the typeof the parameter.

# a) Add an if statement to your reverse_characters function to check the type of the parameter.
def reverse_characters(value):
if isinstance(value, int):
value = str(value)
chars = list(value)
chars.reverse()
return "".join(chars)
# b - d) If type is ‘string’, return the reversed string as before. If type is ‘number’, convert the parameter to a string, reverse the characters, then convert it back into a number. Return the reversed number.
# e) Be sure to print the result returned by the function to verify that your code works for both strings and numbers. Do this before moving on to the next steps.

4321
101CL
9035768
radar
# 3) Create a new function with one parameter, which is the list we want to change. The function should:
# a) Define and initialize an empty list.
def reverse_characters(value):
if isinstance(value, int):
value = str(value)
chars = list(value)
chars.reverse()
return "".join(chars)
# b) Loop through the old list.

# c) For each element in the old list, call reverse_characters to flip the characters or digits.
# d) Add the reversed string (or number) to the list defined in part ‘a’.
# e) Return the final, reversed list.
Expand Down
11 changes: 9 additions & 2 deletions loops/exercises/for-loop-exercises.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
# Exercise #1: Construct for loops that accomplish the following tasks:
# a. Print the numbers 0 - 20, one number per line.
for num in range(21):
print (num)
# b. Print only the ODD values from 3 - 29, one number per line.
for num in range(3,30,2):
print(num)
# c. Print the EVEN numbers 12 to -14 in descending order, one number per line.
for num in range(12,-14,-2):
print(num)
# d. Challenge - Print the numbers 50 - 20 in descending order, but only if the numbers are multiples of 3. (Your code should work even if you replace 50 or 20 with other numbers).


for num in range(50,20-1,-1)
if num % 3 == 0:
print(num)

4 changes: 3 additions & 1 deletion loops/exercises/while-loop-exercises.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Define three variables for the LaunchCode shuttle - one for the starting fuel level, another for the number of astronauts aboard, and the third for the altitude the shuttle reaches.

starting_fuel_level = 100
number_of_astronauts_aboard = 8
altitude_shuttle_reached = 1600



Expand Down
Loading