Skip to content

Commit 2056226

Browse files
committed
moved all files
1 parent 4bc843d commit 2056226

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+4396
-1
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.venv
2+
__pycache__

README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,18 @@
1-
# DSWD-CodeQuest-Backend
1+
<h1 align="center">🚀30 Days of Backend🚀</h1>
2+
3+
Welcome to **30 Days of Backend**! 🚀 This is an exciting month-long journey that will take you deep into the heart of web development. Whether you're a seasoned coder 🧑‍💻 with years of experience or a curious newbie 🤓 eager to learn, get ready to unlock the secrets of the backend 🔐. We will explore the fundamental principles of Python, databases, APIs, and so much more.
4+
5+
But it's not all theory and technical jargon, we'll put our knowledge to the test by building fun, practical projects 🛠️ that showcase the power of backend development. It's a hands-on learning experience that will not only equip you with valuable skills but also inspire your creativity. So, are you ready to embark on this exciting coding journey with us?
6+
7+
<hr>
8+
9+
### 📅 The 30-Day Content:
10+
11+
|<div align='center'><a href='backend/day-1'><img src='backend/assets/test.png' alt='Introduction to Python' width='140px'/></a><h4 align='center'><a href='backend/day-1'>Introduction to Python</a></h4></div> |<div align='center'><a href='backend/day-2'><img src='backend/assets/test.png' alt='Data Types' width='140px'/></a><h4 align='center'><a href='backend/day-2'>Data Types</a></h4></div> |<div align='center'><a href='backend/day-3'><img src='backend/assets/test.png' alt='Conditionals' width='140px'/></a><h4 align='center'><a href='backend/day-3'>Conditionals</a></h4></div> |<div align='center'><a href='backend/day-4'><img src='backend/assets/test.png' alt='Logical Operators' width='140px'/></a><h4 align='center'><a href='backend/day-4'>Logical Operators</a></h4></div> |
12+
| - | - | - | - |
13+
|<div align='center'><a href='backend/day-5'><img src='backend/assets/test.png' alt='random' width='140px'/></a><h4 align='center'><a href='backend/day-5'>random</a></h4></div> |<div align='center'><a href='backend/day-6'><img src='backend/assets/test.png' alt='Loops' width='140px'/></a><h4 align='center'><a href='backend/day-6'>Loops</a></h4></div> |<div align='center'><a href='backend/day-7'><img src='backend/assets/test.png' alt='Lists and Dicts (MINI PROJECT)' width='140px'/></a><h4 align='center'><a href='backend/day-7'>Lists and Dicts (MINI PROJECT)</a></h4></div> |<div align='center'><a href='backend/day-8'><img src='backend/assets/test.png' alt='Functions' width='140px'/></a><h4 align='center'><a href='backend/day-8'>Functions</a></h4></div> |
14+
|<div align='center'><a href='backend/day-9'><img src='backend/assets/test.png' alt='Modules and Packages' width='140px'/></a><h4 align='center'><a href='backend/day-9'>Modules and Packages</a></h4></div> |<div align='center'><a href='backend/day-10'><img src='backend/assets/test.png' alt='Exception Handling' width='140px'/></a><h4 align='center'><a href='backend/day-10'>Exception Handling</a></h4></div> |<div align='center'><a href='backend/day-11'><img src='backend/assets/test.png' alt='File Handling' width='140px'/></a><h4 align='center'><a href='backend/day-11'>File Handling</a></h4></div> |<div align='center'><a href='backend/day-12'><img src='backend/assets/test.png' alt='Classes and Objects' width='140px'/></a><h4 align='center'><a href='backend/day-12'>Classes and Objects</a></h4></div> |
15+
|<div align='center'><a href='backend/day-13'><img src='backend/assets/test.png' alt='Pillars of OOP' width='140px'/></a><h4 align='center'><a href='backend/day-13'>Pillars of OOP</a></h4></div> |<div align='center'><a href='backend/day-14'><img src='backend/assets/test.png' alt='Pillars of OOP (cont)' width='140px'/></a><h4 align='center'><a href='backend/day-14'>Pillars of OOP (cont)</a></h4></div> |<div align='center'><a href='backend/day-15'><img src='backend/assets/test.png' alt='MINI PROJECT' width='140px'/></a><h4 align='center'><a href='backend/day-15'>MINI PROJECT</a></h4></div> |<div align='center'><a href='backend/day-16'><img src='backend/assets/test.png' alt='Virtual Environmnent' width='140px'/></a><h4 align='center'><a href='backend/day-16'>Virtual Environmnent</a></h4></div> |
16+
|<div align='center'><a href='backend/day-17'><img src='backend/assets/test.png' alt='HTTP Methods' width='140px'/></a><h4 align='center'><a href='backend/day-17'>HTTP Methods</a></h4></div> |<div align='center'><a href='backend/day-18'><img src='backend/assets/test.png' alt='Query Parameters' width='140px'/></a><h4 align='center'><a href='backend/day-18'>Query Parameters</a></h4></div> |<div align='center'><a href='backend/day-19'><img src='backend/assets/test.png' alt='Request and <br>Response Handling' width='140px'/></a><h4 align='center'><a href='backend/day-19'>Request and <br>Response Handling</a></h4></div> |<div align='center'><a href='backend/day-20'><img src='backend/assets/test.png' alt='Server and Routing' width='140px'/></a><h4 align='center'><a href='backend/day-20'>Server and Routing</a></h4></div> |
17+
|<div align='center'><a href='backend/day-21'><img src='backend/assets/test.png' alt='Blueprints' width='140px'/></a><h4 align='center'><a href='backend/day-21'>Blueprints</a></h4></div> |<div align='center'><a href='backend/day-22'><img src='backend/assets/test.png' alt='Jinja' width='140px'/></a><h4 align='center'><a href='backend/day-22'>Jinja</a></h4></div> |<div align='center'><a href='backend/day-23'><img src='backend/assets/test.png' alt='REST APIs' width='140px'/></a><h4 align='center'><a href='backend/day-23'>REST APIs</a></h4></div> |<div align='center'><a href='backend/day-24'><img src='backend/assets/test.png' alt='Introduction to SQLite' width='140px'/></a><h4 align='center'><a href='backend/day-24'>Introduction to SQLite</a></h4></div> |
18+
|<div align='center'><a href='backend/day-25'><img src='backend/assets/test.png' alt='Setting up SQLite in Flask' width='140px'/></a><h4 align='center'><a href='backend/day-25'>Setting up SQLite in Flask</a></h4></div> |<div align='center'><a href='backend/day-26'><img src='backend/assets/test.png' alt='Defining Databases' width='140px'/></a><h4 align='center'><a href='backend/day-26'>Defining Databases</a></h4></div> |<div align='center'><a href='backend/day-27'><img src='backend/assets/test.png' alt='CRUD' width='140px'/></a><h4 align='center'><a href='backend/day-27'>CRUD</a></h4></div> |<div align='center'><a href='backend/day-28'><img src='backend/assets/test.png' alt='FINAL PROJECT' width='140px'/></a><h4 align='center'><a href='backend/day-28'>FINAL PROJECT</a></h4></div> |

backend/assets/test.png

681 KB
Loading

backend/day-01/README.md

Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
<h1 align="center">Introduction to Python</h1>
2+
<hr>
3+
4+
<div align="center" style="display: flex;">
5+
<img src="https://i.gifer.com/XOsX.gif" height="64px" align="center">
6+
<h2 align="center">So What is Python</h2>
7+
<img src="https://i.gifer.com/XOsX.gif" height="64px">
8+
</div>
9+
</div>
10+
11+
<br />
12+
13+
<div align="center">
14+
<img src="assets/python_logo.png" alt="Python_Logo" height="100px"/>
15+
</div>
16+
17+
- Python is a **[high-level programming language](https://en.wikipedia.org/wiki/High-level_programming_language)**, which means it is user-friendly and easy for programmers to understand and learn. Python is renowned for its readability and ease of use. It is utilized in various fields, including web development, data analysis, machine learning, and more.
18+
19+
20+
#### Python Coding Environment
21+
22+
<img src="assets/code_editor.PNG" alt="VSCode" height="500px"/>
23+
24+
<br />
25+
<br />
26+
27+
- There are many popular IDEs and code editors, such as IDLE, Visual Studio Code, and PyCharm, but we will be using Visual Studio Code.
28+
29+
- If you haven't set up VSCode and Python yet, please [follow this tutorial.](https://youtu.be/zk5qOQBvuK4?si=TTp-ot2_VN6lorua)
30+
31+
<hr>
32+
33+
<div style="display: flex; justify-content: center;">
34+
<div style="display: flex; align-items: center; justify-content: center; gap: 1rem; border: 1px solid white; width: fit-content;">
35+
<img src="https://i.gifer.com/XOsX.gif" height="64px">
36+
<h2 align="center">Printing</h2>
37+
<img src="https://i.gifer.com/XOsX.gif" height="64px">
38+
</div>
39+
</div>
40+
41+
<br>
42+
43+
Printing in Python refers to the process of displaying text or data on the screen, typically in the console or terminal.
44+
In Python, you can use the `print()` function to output information, messages, variables, or any content you want to see during the program's execution.
45+
46+
Here's how printing works in Python:
47+
48+
The `print()` function:
49+
- Used for printing text and values to the console
50+
- You can print text by enclosing it in either single quotes `' '`, double quotes `" "`, or triple quotes `''' '''` or `""" """`
51+
52+
```Python
53+
# single quotes
54+
print('Department of Software and Web Development ૮꒰ ˶• ༝ •˶꒱ა ♡')
55+
56+
# double quotes
57+
print("Department of Software and Web Development ૮꒰ ˶• ༝ •˶꒱ა ♡")
58+
59+
# triple quotes (for multi-line strings)
60+
print("""Department of \
61+
Software and Web Development \
62+
૮꒰ ˶• ༝ •˶꒱ა ♡""")
63+
```
64+
65+
Output:
66+
67+
```
68+
Department of Software and Web Development ૮꒰ ˶• ༝ •˶꒱ა ♡
69+
Department of Software and Web Development ૮꒰ ˶• ༝ •˶꒱ა ♡
70+
Department of Software and Web Development ૮꒰ ˶• ༝ •˶꒱ა ♡
71+
```
72+
73+
- You can format the printed output by using the following escape characters:
74+
`\n`: Inserts a new line.
75+
`\t`: Inserts a tab.
76+
`\"` or `\'`: Escapes double or single quotes within a string.
77+
78+
```Python
79+
print("Line 1\nLine 2")
80+
print("Tabbed\tText")
81+
print("\"Hello\" World!")
82+
```
83+
84+
Output:
85+
```
86+
Line 1
87+
Line 2
88+
Tabbed Text
89+
"Hello" World
90+
```
91+
92+
93+
<hr>
94+
95+
<div style="display: flex; justify-content: center;">
96+
<div style="display: flex; align-items: center; justify-content: center; gap: 1rem; border: 1px solid white; width: fit-content;">
97+
<img src="https://i.gifer.com/XOsX.gif" height="64px">
98+
<h2 align="center">Variables</h2>
99+
<img src="https://i.gifer.com/XOsX.gif" height="64px">
100+
</div>
101+
</div>
102+
103+
<br/>
104+
105+
```Python
106+
message = "Hello World"
107+
```
108+
109+
#### What are variables?
110+
111+
Variables are symbolic names used to store data. They are essential for data storage, flexibility, code readability, reusability, and data transformation in software development.
112+
113+
When naming variables, it's important to use descriptive names that follow conventions such as using meaningful words, `camelCase` or `snake_case`, avoiding reserved words, and being consistent in your naming style. Proper variable naming enhances code readability and maintainability.
114+
115+
#### Variable Assignment
116+
117+
```Python
118+
message = "Hello world!"
119+
random_word = "Software"
120+
birth_month = "March"
121+
year_born = 2004
122+
is_handsome = True
123+
```
124+
125+
Python doesn't require you to specify the type of each variables you declare.
126+
127+
This is possible because Python is doing it through a process called [type inference](https://en.wikipedia.org/wiki/Type_inference). <sup>*(While it's not necessary for you to fully understand it, it's never a bad thing that you're aware it exists.)*</sup>
128+
129+
The value of a variable can also be changed, here is an example:
130+
131+
```Python
132+
message = "Hello World!"
133+
print(message)
134+
message = "Hi"
135+
print(message)
136+
```
137+
138+
Output:
139+
```
140+
Hello World!
141+
Hi
142+
```
143+
144+
Printing Using Variables:
145+
- There are lots of ways we can print variables but we will be focusing on `f-strings`:
146+
147+
```Python
148+
my_name = "John"
149+
print(f"Hello, I am {my_name}. Have a wonderful day!")
150+
```
151+
Output:
152+
```
153+
Hello, I am John. Have a wonderful day!
154+
```
155+
156+
F-strings are a way to create dynamic and readable text in Python.
157+
158+
You can put variables and expressions inside curly braces `{}` within a string, and Python will fill in the values when the string is created. This makes it easy to generate text that changes based on data or calculations. F-strings start with `f` or `F` and are a handy feature for making your code more readable and efficient.
159+
160+
<hr>
161+
162+
<div style="display: flex; align-items: center; justify-content: center; gap: 1rem; border: 1px solid white;">
163+
<img src="https://i.gifer.com/6tXM.gif" height="64px"/>
164+
<h1 align="center">CHALLENGE TIME!!!</h1>
165+
<img src="https://i.gifer.com/6tXM.gif" height="64px"/>
166+
</div>
167+
168+
<br>
169+
170+
Based on this output try to recreate it using what you have learned today! Remember to not just print the whole thing, use variables for good practice. Replace the curly braces with whatever you like as long as it is not inappropriate. You may add more if you like.
171+
172+
The output should look like this:
173+
174+
```
175+
Hello, I am {your_name}. I love {name_of_department} and I love being in the Backend even more!
176+
One thing about me is that {about_you}.
177+
```
42.9 KB
Loading
16.7 KB
Loading

backend/day-01/test.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
name = None
2+
age = None
3+
isMale = None
4+
department = None
5+
6+
print(f"{name} is an {age}-year old {'male' if isMale else 'female'} participating in {department}'s 30 Days of Coding.")

backend/day-02/README.md

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
<h1 align="center">Day 2: Basic Data Types and User Inputs</h1>
2+
<hr>
3+
4+
<h2 align='center'>Data Types</h2>
5+
6+
Let's start your Day 2 of Backend Development with the introduction to **Basic Data Types**.
7+
8+
### ❓ What is a Data Type?
9+
10+
- You can think of data type as an attribute, or as the name suggests, a *type*, associated with the data being used within our program, and it tells the compiler or interpreter how its value should be treated.
11+
12+
### 👀 Common Data Types
13+
14+
There are various data types present in different programming languages, but here are the most basic forms of data types that you should be aware of:
15+
16+
#### Integer
17+
- often shortened as *int*, it is a data type representing any whole numbers.
18+
19+
To have a variable with integer data type in Python, initialize it with any integer value:
20+
21+
```Python
22+
my_int = 10
23+
```
24+
25+
You may remember that Python has [type inference](https://en.wikipedia.org/wiki/Type_inference), so you don't need to specify its data type when declaring any variables.
26+
27+
#### Float
28+
- represents numbers with floating point.
29+
30+
To have a variable with data type in Python:
31+
```Python
32+
my_float = 1.23
33+
```
34+
35+
#### Character
36+
- often shortened as *char*, it represents a single character.
37+
38+
Although Python doesn't have a character data type, instead, it uses a data type called **string**.
39+
40+
#### String
41+
- often shortened as *str*, it represents a sequence of characters. You may declare a string enclosed in single, double, or triple quotes.
42+
43+
```Python
44+
my_str = 'Hello, AWSCC!'
45+
my_str1 = "Hello, DSWD!"
46+
my_str2 = '''Hello, Backend!'''
47+
```
48+
49+
#### Boolean
50+
- often shortened as *bool*, it represents the two Boolean values: `True` or `False`. This can be very useful for logical operations and conditions.
51+
52+
```python
53+
my_bool = True
54+
your_bool = False
55+
```
56+
57+
#### Null Type
58+
- a special kind of data type that only represents a single value: `None`. This is used when a variable does not contain any value.
59+
60+
```python
61+
null = None
62+
```
63+
<hr>
64+
65+
<h3 align='center'>User Inputs</h3>
66+
67+
You learned in Day 1 that we can print an output simply by using `print()`. This time, let's learn how to take an input from the user.
68+
69+
To take an input from the user, you can simply use (*and you might have guessed it already*) `input()`.
70+
71+
72+
Here's a simple Python code that uses `input()` to ask the user their age and store it in the `age` variable.
73+
74+
```Python
75+
76+
age = input("Enter your age: ")
77+
print(f"You're {age} years old.")
78+
```
79+
80+
You can try running it in `day-2-input.py` inside this folder.
81+
82+
---
83+
84+
<h1 align='center'>CHALLENGE TIME!!!</h1>
85+
86+
Since you are now familiarized with the basic data types and the `input()` function, it's time for you to take on some challenges:
87+
88+
Write a Python program that prompts the user to enter three integer values and then calculates and displays their sum.
89+
90+
The output may look like this:
91+
92+
```
93+
Enter the first number: 5
94+
Enter the second number: 19
95+
Enter the third number: 11
96+
97+
Sum: 35
98+
```
99+
100+
---
101+
102+
### Additional Resources
103+
- [What are Data Types and Why Are They Important?](https://amplitude.com/blog/data-types)
104+
- [Programming Fundamentals: Data Types](https://press.rebus.community/programmingfundamentals/chapter/data-types/)
105+
- [Python Basic Input and Output](https://www.programiz.com/python-programming/input-output-import)

backend/day-02/day-2-input.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
age = input("Enter your age: ")
2+
print(f"You're {age} years old.")

backend/day-02/day-2.py

Whitespace-only changes.

0 commit comments

Comments
 (0)