Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
2177399
added my code
November2025 Oct 20, 2024
b1e6cdb
worked on w1u3 excercises
November2025 Oct 20, 2024
ad34dba
workedn w1u4
November2025 Oct 20, 2024
340f6f5
worked w1u5
November2025 Oct 20, 2024
f8cf6a0
worked w1u6
November2025 Oct 20, 2024
ade5457
worked w1u7
November2025 Oct 20, 2024
cb2eb1d
worked on w1final
November2025 Oct 20, 2024
0746943
tried to work on bonus:(
November2025 Oct 20, 2024
daa3d1f
worked on w2u1
November2025 Oct 20, 2024
e535a6b
reviewed and ran code to see what works and what does not
November2025 Oct 20, 2024
325eda6
ran code for w2u3
November2025 Oct 20, 2024
ad01304
worked w2u4
November2025 Oct 20, 2024
0ae1ab3
worked w2u5
November2025 Oct 21, 2024
949ed76
worked w2u6
November2025 Oct 21, 2024
aefc836
worked w2u7
November2025 Oct 21, 2024
296740d
worked w2u8
November2025 Oct 21, 2024
26db113
workedw2final
November2025 Oct 21, 2024
c5b2a02
worked on w3u1
November2025 Oct 23, 2024
ef7d598
worked on w3u2
November2025 Oct 23, 2024
607ff95
worked w3u3
November2025 Oct 24, 2024
e06a2cf
cloned & pushed repo :)
November2025 Oct 24, 2024
806cf0e
worked w3u4
November2025 Oct 28, 2024
8186f81
worked w3u5
November2025 Oct 28, 2024
b759ba2
worked w3u6
November2025 Oct 28, 2024
96c7db5
worked w3solution
November2025 Oct 28, 2024
1b36068
worked on w3bonus
November2025 Oct 29, 2024
7ecc91e
worked & researched w4u1
November2025 Oct 29, 2024
e0da3ea
worked on w4u2 and added edit for txt file
November2025 Oct 29, 2024
d2bc08a
modified file name for locating purposes and cell ran
November2025 Oct 29, 2024
03a9539
added nums file and cell ran as designed
November2025 Oct 29, 2024
9ce13dc
added code to sum up nums file
November2025 Oct 29, 2024
97f4959
worked w4u4
November2025 Oct 30, 2024
83f3141
worked w4u5
November2025 Nov 2, 2024
fd2583e
worked w34bonus
November2025 Nov 3, 2024
3fedbf0
worked w4bonus
November2025 Nov 3, 2024
fa1a407
worked w4sol
November2025 Nov 3, 2024
c3092ce
w5u1
November2025 Nov 3, 2024
14f4d1a
w5u2
November2025 Nov 3, 2024
707d8d2
w5u3
November2025 Nov 12, 2024
7f5f20f
worked w5u4
November2025 Nov 12, 2024
3cc5b18
w5u5
November2025 Nov 14, 2024
2ea9bc1
w5u6
November2025 Nov 15, 2024
58115ad
worked on w5u7
November2025 Nov 19, 2024
664d6db
reviewed and ran w5bonus
November2025 Nov 19, 2024
ac21bf9
ran code/studied w5sol
November2025 Nov 19, 2024
26cad14
studied/ran code w6u2
November2025 Nov 19, 2024
f87ba5e
w6u3
November2025 Nov 19, 2024
8f4b516
w6u6
November2025 Dec 5, 2024
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 caesar-cipher
Submodule caesar-cipher added at b58750
1 change: 1 addition & 0 deletions fizzbuzz
Submodule fizzbuzz added at 1ff83a
55 changes: 53 additions & 2 deletions week_1/w1bonus.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,57 @@
"else:\n",
" print(\"The quadratic equation has 2 real solutions.\")"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "4079911d",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"The quadratic equation has no real solutions.\n"
]
}
],
"source": [
"import math\n",
"\n",
"# Function to determine the number of solutions for a quadratic equation\n",
"def find_solutions(a, b, c):\n",
" discriminant = b**2 - 4 * a * c # Calculate the discriminant\n",
" \n",
" if discriminant > 0:\n",
" # Two distinct real solutions\n",
" x1 = (-b + math.sqrt(discriminant)) / (2 * a)\n",
" x2 = (-b - math.sqrt(discriminant)) / (2 * a)\n",
" return f\"The quadratic equation has two distinct real solutions: x1 = {x1}, x2 = {x2}\"\n",
" elif discriminant == 0:\n",
" # One real solution (repeated root)\n",
" x = -b / (2 * a)\n",
" return f\"The quadratic equation has exactly one real solution: x = {x}\"\n",
" else:\n",
" # No real solutions\n",
" return \"The quadratic equation has no real solutions.\"\n",
"\n",
"# Input from the user\n",
"try:\n",
" a = float(input(\"Enter the coefficient a (must not be 0): \"))\n",
" if a == 0:\n",
" print(\"Coefficient a must not be zero for a quadratic equation.\")\n",
" else:\n",
" b = float(input(\"Enter the coefficient b: \"))\n",
" c = float(input(\"Enter the coefficient c: \"))\n",
"\n",
" # Determine and print the number of solutions\n",
" result = find_solutions(a, b, c)\n",
" print(result)\n",
"\n",
"except ValueError:\n",
" print(\"Please enter valid numerical values for the coefficients.\")\n"
]
}
],
"metadata": {
Expand All @@ -89,9 +140,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.7"
"version": "3.13.0"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
}
60 changes: 43 additions & 17 deletions week_1/w1final.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,51 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"The triangle is classified as: Acute triangle\n"
]
}
],
"source": [
"angle_1 = int(input(\"Please enter the first angle: \"))\n",
"angle_2 = int(input(\"Please enter the second angle: \"))\n",
"angle_3 = int(input(\"Please enter the third angle: \"))\n",
"# Function to classify the triangle based on its angles\n",
"def classify_triangle(angles):\n",
" a, b, c = angles\n",
" \n",
" # Classifying the triangle based on angle measures\n",
" if a == 90 or b == 90 or c == 90:\n",
" return \"Right triangle\"\n",
" elif a < 90 and b < 90 and c < 90:\n",
" return \"Acute triangle\"\n",
" else:\n",
" return \"Obtuse triangle\"\n",
"\n",
"# Function to check if the angles form a valid triangle\n",
"def is_valid_triangle(angles):\n",
" return all(angle > 0 for angle in angles) and sum(angles) == 180\n",
"\n",
"if angle_1 <= 0 or angle_2 <= 0 or angle_3 <= 0:\n",
" print(\"Angles smaller than 0 are not valid.\")\n",
"elif angle_1 + angle_2 + angle_3 == 180:\n",
" if angle_1 == 90 or angle_2 == 90 or angle_3 == 90:\n",
" print(\"The triangle is a right triangle.\")\n",
" elif angle_1 > 90 or angle_2 > 90 or angle_3 > 90:\n",
" print(\"The triangle is an obtuse triangle.\")\n",
"# Input from the user\n",
"try:\n",
" angle1 = int(input(\"Enter the first angle in degrees: \"))\n",
" angle2 = int(input(\"Enter the second angle in degrees: \"))\n",
" angle3 = int(input(\"Enter the third angle in degrees: \"))\n",
" \n",
" angles = (angle1, angle2, angle3)\n",
" \n",
" # Check if the angles form a valid triangle\n",
" if is_valid_triangle(angles):\n",
" triangle_type = classify_triangle(angles)\n",
" print(f\"The triangle is classified as: {triangle_type}\")\n",
" else:\n",
" print(\"The triangle is an acute triangle.\")\n",
"else:\n",
" print(\"The entered values are not valid.\")\n"
" print(\"The entered angles are not valid. They must be > 0 and their sum must be 180°.\")\n",
"except ValueError:\n",
" print(\"Please enter valid integer values for the angles.\")\n",
"\n"
]
}
],
Expand All @@ -76,9 +102,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.7"
"version": "3.13.0"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
}
45 changes: 40 additions & 5 deletions week_1/w1u2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -463,11 +463,46 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"id": "f0e63c53",
"metadata": {},
"outputs": [],
"source": []
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Cube Surface Area: 150\n",
"Cube Volume: 125\n",
"Cuboid Surface Area: 94\n",
"Cuboid Volume: 60\n"
]
}
],
"source": [
"# Cube calculations\n",
"a = 5 # Assign a value for the side length of the cube\n",
"\n",
"# Surface area and volume of a cube\n",
"cube_area = 6 * (a ** 2)\n",
"cube_volume = a ** 3\n",
"\n",
"# Output the results for the cube\n",
"print(\"Cube Surface Area:\", cube_area)\n",
"print(\"Cube Volume:\", cube_volume)\n",
"\n",
"# Cuboid calculations\n",
"a = 5 # Side length a\n",
"b = 3 # Side length b\n",
"c = 4 # Side length c\n",
"\n",
"# Surface area and volume of a cuboid\n",
"cuboid_area = 2 * (a * b + b * c + a * c)\n",
"cuboid_volume = a * b * c\n",
"\n",
"# Output the results for the cuboid\n",
"print(\"Cuboid Surface Area:\", cuboid_area)\n",
"print(\"Cuboid Volume:\", cuboid_volume)\n"
]
}
],
"metadata": {
Expand All @@ -489,9 +524,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.1"
"version": "3.13.0"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
}
64 changes: 55 additions & 9 deletions week_1/w1u3.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,39 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": []
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"You entered the following details:\n",
"First Name: amanda\n",
"Last Name: wilson\n",
"Email Address: amanda88715@gmail.com\n"
]
}
],
"source": [
"# Retrieve user input for first name, last name, and email address\n",
"first_name = input(\"Enter your first name: \")\n",
"last_name = input(\"Enter your last name: \")\n",
"email = input(\"Enter your email address: \")\n",
"\n",
"# Output the entered values\n",
"print(\"\\nYou entered the following details:\")\n",
"print(\"First Name:\", first_name)\n",
"print(\"Last Name:\", last_name)\n",
"print(\"Email Address:\", email)\n"
]
},
{
"cell_type": "markdown",
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"### Exercise 2\n",
"\n",
Expand All @@ -130,10 +155,31 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": []
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"The sum is 78.0.\n",
"The product is 77.0.\n"
]
}
],
"source": [
"# Accept two numbers from the user\n",
"num1 = float(input(\"Enter the first number: \"))\n",
"num2 = float(input(\"Enter the second number: \"))\n",
"\n",
"# Calculate the sum and product\n",
"sum_of_numbers = num1 + num2\n",
"product_of_numbers = num1 * num2\n",
"\n",
"# Output the results\n",
"print(f\"The sum is {sum_of_numbers}.\")\n",
"print(f\"The product is {product_of_numbers}.\")\n"
]
}
],
"metadata": {
Expand All @@ -156,7 +202,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.7"
"version": "3.13.0"
},
"mimetype": "text/x-python",
"name": "python",
Expand All @@ -166,4 +212,4 @@
},
"nbformat": 4,
"nbformat_minor": 2
}
}
Loading