MCPcopy
hub / github.com/Asabeneh/30-Days-Of-Python

github.com/Asabeneh/30-Days-Of-Python @main sqlite

repository ↗ · DeepWiki ↗
26 symbols 34 edges 21 files 0 documented · 0%
README

🐍 30 Days Of Python

# Day Topics
01 Introduction
02 Variables, Built-in Functions
03 Operators
04 Strings
05 Lists
06 Tuples
07 Sets
08 Dictionaries
09 Conditionals
10 Loops
11 Functions
12 Modules
13 List Comprehension
14 Higher Order Functions
15 Python Type Errors
16 Python Date time
17 Exception Handling
18 Regular Expressions
19 File Handling
20 Python Package Manager
21 Classes and Objects
22 Web Scraping
23 Virtual Environment
24 Statistics
25 Pandas
26 Python web
27 Python with MongoDB
28 API
29 Building API
30 Conclusions

🧡🧡🧡 HAPPY CODING 🧡🧡🧡


💖 Sponsors

Our amazing sponsors for supporting my open-source contribution and the 30 Days of Challenge series!

Current Sponsors


  <img src="https://raw.githubusercontent.com/Asabeneh/asabeneh/master/images/Wispr_Flow-logo.png"
       width="400px"
       alt="Wispr Flow Logo"
       title="Wispr Flow" />

Talk to code, stay in the Flow.

Flow is built for devs who live in their tools. Speak and give more context, get better results.


  <img src="https://raw.githubusercontent.com/Asabeneh/asabeneh/master/images/petrosky-logo-black.png"
       width="400px"
       alt="Petrosky Logo"
       title="Petrosky" />

A hosting for your entire journey!

Affordable VPS Hosting Services For All Your Needs


🙌 Become a Sponsor

You can support this project by becoming a sponsor on GitHub Sponsors or through PayPal.

Every contribution, big or small, makes a huge difference. Thank you for your support! 🌟


30 Days Of Python: Day 1 - Introduction

Twitter Follow

Author: Asabeneh Yetayeh

Second Edition: July, 2021

🇧🇷 Portuguese 🇨🇳 中文

Day 2 >>

30DaysOfPython

📘 Day 1

Welcome

Congratulations for deciding to participate in a 30 days of Python programming challenge. In this challenge, you will learn everything you need to be a python programmer and the whole concept of programming. In the end of the challenge you will get a 30DaysOfPython programming challenge certificate.

If you would like to actively engage in the challenge, you may join the 30DaysOfPython challenge telegram group.

Introduction

Python is a high-level programming language for general-purpose programming. It is an open source, interpreted, object-oriented programming language. Python was created by a Dutch programmer, Guido van Rossum. The name of the Python programming language was derived from a British sketch comedy series, Monty Python's Flying Circus. The first version was released on February 20, 1991. This 30 days of Python challenge will help you learn the latest version of Python, Python 3 step by step. The topics are broken down into 30 days, where each day contains several topics with easy-to-understand explanations, real-world examples, and many hands on exercises and projects.

This challenge is designed for beginners and professionals who want to learn python programming language. It may take 30 to 100 days to complete the challenge. People who actively participate in the telegram group have a high probability of completing the challenge.

This challenge is easy to read, written in conversational English, engaging, motivating and at the same time, it is very demanding. You need to allocate much time to finish this challenge. If you are a visual learner, you may get the video lesson on Washera YouTube channel. You may start from Python for Absolute Beginners video. Subscribe the channel, comment and ask questions on YouTube videos and be proactive, the author will eventually notice you.

The author likes to hear your opinion about the challenge, share the author by expressing your thoughts about the 30DaysOfPython challenge. You can leave your testimonial on this link

Why Python ?

It is a programming language which is very close to human language and because of that, it is easy to learn and use. Python is used by various industries and companies (including Google). It has been used to develop web applications, desktop applications, system administration, and machine learning libraries. Python is a highly embraced language in the data science and machine learning community. I hope this is enough to convince you to start learning Python. Python is eating the world and you are killing it before it eats you.

Environment Setup

Installing Python

To run a python script you need to install python. Let's download python. If your are a windows user, click the button encircled in red.

installing on Windows

If you are a macOS user, click the button encircled in red.

installing on Windows

To check if python is installed write the following command on your device terminal.

python3 --version

Python Version

As you can see from the terminal, I am using Python 3.7.5 version at the moment. Your version of Python might be different from mine by but it should be 3.6 or above. If you manage to see the python version, well done. Python has been installed on your machine. Continue to the next section.

Python Shell

Python is an interpreted scripting language, so it does not need to be compiled. It means it executes the code line by line. Python comes with a Python Shell (Python Interactive Shell). It is used to execute a single python command and get the result.

Python Shell waits for the Python code from the user. When you enter the code, it interprets the code and shows the result in the next line. Open your terminal or command prompt(cmd) and write:

python

Python Scripting Shell

The Python interactive shell is opened and it is waiting for you to write Python code(Python script). You will write your Python script next to this symbol >>> and then click Enter. Let us write our very first script on the Python scripting shell.

Python script on Python shell

Well done, you wrote your first Python script on Python interactive shell. How do we close the Python interactive shell ? To close the shell, next to this symbol >>> write exit() command and press Enter.

Exit from python shell

Now, you know how to open the Python interactive shell and how to exit from it.

Python will give you results if you write scripts that Python understands, if not it returns errors. Let's make a deliberate mistake and see what Python will return.

Invalid Syntax Error

As you can see from the returned error, Python is so clever that it knows the mistake we made and which was Syntax Error: invalid syntax. Using x as multiplication in Python is a syntax error because (x) is not a valid syntax in Python. Instead of (x) we use asterisk (*) for multiplication. The returned error clearly shows what to fix.

The process of identifying and removing errors from a program is called debugging. Let us debug it by putting * in place of x.

Fixing Syntax Error

Our bug was fixed, the code ran and we got a result we were expecting. As a programmer you will see such kind of errors on daily basis. It is good to know how to debug. To be good at debugging you should understand what kind of errors you are facing. Some of the Python errors you may encounter are SyntaxError, IndexError, NameError, ModuleNotFoundError, KeyError, ImportError, AttributeError, TypeError, ValueError, ZeroDivisionError etc. We will see more about different Python error types in later sections.

Let us practice more how to use Python interactive shell. Go to your terminal or command prompt and write the word python.

Python Scripting Shell

The Python interactive shell is opened. Let us do some basic mathematical operations (addition, subtraction, multiplication, division, modulus, exponentiation).

Let us do some maths first before we write any Python code:

  • 2 + 3 = 5
  • 3 - 2 = 1
  • 3 * 2 = 6
  • 3 / 2 = 1.5
  • 3 ** 2 = 3 x 3 = 9

In python, we have the following additional operations:

  • 3 % 2 = 1 => which means finding the remainder
  • 3 // 2 = 1 => which means removing the remainder

Let us change the above mathematical expressions to Python code. The Python shell has been opened and let us write a comment at the very beginning of the shell.

A comment is a part of the code which is not executed by python. So we can leave some text in our code to make our code more readable. Python does not run the comment part. A comment in python starts with hash(#) symbol. This is how you write a comment in python

 # comment starts with hash
 # this is a python comment, because it starts with a (#) symbol

Maths on python shell

Before we move on to the next sect

Core symbols most depended-on inside this repo

generate_full_name
called by 0
mymodule.py
sum_two_nums
called by 0
mymodule.py
home
called by 0
python_for_web/app.py
about
called by 0
python_for_web/app.py
result
called by 0
python_for_web/app.py
post
called by 0
python_for_web/app.py
greet_person
called by 0
mypackage/greet.py
add_numbers
called by 0
mypackage/arithmetics.py

Shape

Function 22
Route 4

Languages

Python100%

Modules by API surface

python_for_web/app.py8 symbols
mypackage/arithmetics.py6 symbols
20_Day_Python_package_manager/arithmetic.py6 symbols
mymodule.py2 symbols
12_Day_Modules/mymodule.py2 symbols
mypackage/greet.py1 symbols
20_Day_Python_package_manager/greet.py1 symbols

Dependencies from manifests, versioned

Click7.0 · 1×
Flask1.1.1 · 1×
Jinja22.10.3 · 1×
MarkupSafe1.1.1 · 1×
Werkzeug0.16.0 · 1×
itsdangerous1.1.0 · 1×

Datastores touched

(mongodb)Database · 1 repos

For agents

$ claude mcp add 30-Days-Of-Python \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact