![30DaysOfPython](./images/30DaysOfPython_banner3@2x.png)
𧳠[Part 1: Day 1 - 3](https://github.com/Asabeneh/30-Days-Of-Python)
𧳠[Part 2: Day 4 - 6](https://github.com/Asabeneh/30-Days-Of-Python/blob/master/readme4-6.md)
𧳠[Part 3: Day 7 - 9](https://github.com/Asabeneh/30-Days-Of-Python/blob/master/readme7-9.md)
𧳠[Part 4: Day 10 - 12](https://github.com/Asabeneh/30-Days-Of-Python/blob/master/readme10-12.md)
𧳠[Part 5: Day 13 - 15](https://github.com/Asabeneh/30-Days-Of-Python/blob/master/readme13-15.md)
𧳠[Part 6: Day 16 - 18](https://github.com/Asabeneh/30-Days-Of-Python/blob/master/readme16-18.md)
𧳠[Part 7: Day 19 - 21](https://github.com/Asabeneh/30-Days-Of-Python/blob/master/readme19-21.md)
𧳠[Part 8: Day 22 - 24](https://github.com/Asabeneh/30-Days-Of-Python/blob/master/readme22-24.md)
𧳠[Part 9: Day 25 - 27](https://github.com/Asabeneh/30-Days-Of-Python/blob/master/readme25-27.md)
𧳠[Part 10: Day 28 - 30](https://github.com/Asabeneh/30-Days-Of-Python/blob/master/readme28-30.md)
---
- [ð Day 1](#%f0%9f%93%98-day-1)
- [Welcome](#welcome)
- [Introduction](#introduction)
- [Why Python ?](#why-python)
- [Environment Setup](#environment-setup)
- [Installing Python](#installing-python)
- [Python Shell](#python-shell)
- [Installing Visual Studio Code](#installing-visual-studio-code)
- [How to use visual studio code](#how-to-use-visual-studio-code)
- [Basic Python](#basic-python)
- [Python Syntax](#python-syntax)
- [Python Indentation](#python-indentation)
- [Comment](#comment)
- [Data types](#data-types)
- [Number](#number)
- [String](#string)
- [Booleans](#booleans)
- [List](#list)
- [Dictionary](#dictionary)
- [Tuple](#tuple)
- [Set](#set)
- [Checking Data types](#checking-data-types)
- [Python File](#python-file)
- [ð» Exercises - Day 1](#%f0%9f%92%bb-exercises---day-1)
- [ð Day 2](#%f0%9f%93%98-day-2)
- [Built in functions](#built-in-functions)
- [Variables](#variables)
- [Data Types](#data-types-1)
- [Checking Data types and Casting](#checking-data-types-and-casting)
- [Number](#number-1)
- [ð» Exercises - Day 2](#%f0%9f%92%bb-exercises---day-2)
- [ð Day 3](#%f0%9f%93%98-day-3)
- [Boolean](#boolean)
- [Operators:](#operators)
- [Assignment Operators:](#assignment-operators)
- [Arithmetic Operators:](#arithmetic-operators)
- [Comparison Operators](#comparison-operators)
- [Logical Operators](#logical-operators)
- [ð» Exercises - Day 3](#%f0%9f%92%bb-exercises---day-3)
# ð 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 concepts of programming. In the end of the challenge you will get a **_30DaysOfPython_** programming challenge certificate.
[Join the telegram channel to get help](https://t.me/ThirtyDaysOfPython)
## Introduction
Python is a high-level programming language for general-purpose programming. It is an open source. This 30 days 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 days contains several topics with easy-to-understand explanations, real-world examples and many hands on exercises.
This challenge is designed for beginners and professionals who want to learn python programming language.
## Why Python ?
It is a programming language which is very close to human language and because of that it is easy to learn and easy to use.
Python used in varies industries including Google. It has been used to develop web applications, desktop applications, system adminstration, and machine learning libraries. Python is 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 python script you need to install python. Let's [download](https://www.python.org/) python.
If your are a windows user. Click the button encircled in red.
[![installing on Windows](./images/installing_on_windows.png)](https://www.python.org/)
If you are a macOS user. Click the button encircled in red.
[![installing on Windows](./images/installing_on_macOS.png)](https://www.python.org/)
To check if python is installed write the following command on your device terminal.
```shell
python --version
```
![Python Version](./images/python_versio.png)
As you can see from the terminal, I am using _python 3.7.5_ version at the moment. If you mange 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 doesn't 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:
```shell
python
```
![Python Scripting Shell](images/opening_python_shell.png)
The python interactive shell is opened and it is waiting for you to write python code. You will write your python script next to this symbol >>> and then click Enter.
Lets write our very first script on the python scripting shell.
![Python script on python shell](images/adding_on_python_shell.png)
Well done, you wrote your first python script on python interactive shell. How do we close this shell ?
To close the shell, next to this symbol >> write **exit()** command and press Enter.
![Exit from python shell](images/exit_from_shell.png)
Now, you knew how to open the python interactive shell and how to exit from it.
Python can give you result if you write scripts what python understands if not it returns errors. Let's make a deliberate mistake and see what python will return.
![Invalid Syntax Error](./images/invalid_syntax_error.png)
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's debug it by replacing * in place of **x**.
![Fixing Syntax Error](./images/fixing_syntax_error.png)
Our bug was fixed and the code run 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:SyntaxError, IndexError, ModuleNotFoundError, KeyError, ImportError etc. We will see more about different python **_error types_** in later section .
Let's practice more , how to use python interactive shell. Go to your terminal or command prompt and write the word **python**.
![Python Scripting Shell](images/opening_python_shell.png)
The python interactive shell is open and lets do some basic mathematics operations(addition, subtraction, multiplication, division, modulus, exponential).
Lets 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
Lets change the above mathematical expressions to code. The python shell has been opened and lets write a comment at the very beginning of the shell.
没有合适的资源?快使用搜索试试~ 我知道了~
30-Days-Of-Python-master.zip
共158个文件
png:67个
md:41个
py:18个
需积分: 0 0 下载量 152 浏览量
2023-04-09
12:22:52
上传
评论
收藏 27.48MB ZIP 举报
温馨提示
30-Days-Of-Python-master.zip
资源推荐
资源详情
资源评论
收起资源包目录
30-Days-Of-Python-master.zip (158个子文件)
main.css 3KB
HN_posts_year_to_Sep_26_2016.csv 45.17MB
hacker_news.csv 2.96MB
fortune_500_companies_2017.csv 520KB
result.csv 520KB
weight-height.csv 418KB
fortune1000_final.csv 219KB
F500.csv 48KB
csv_example.csv 76B
.gitignore 2KB
.gitignore 285B
layout.html 1KB
home.html 511B
post.html 392B
about.html 289B
result.html 130B
countries_data.json 65KB
scrapped_data.json 2KB
json_example.json 154B
readme25-27.md 65KB
readme19-21.md 43KB
readme4-6.md 40KB
readme.md 35KB
readme10-12.md 30KB
numpy.md 29KB
readme13-15.md 28KB
readme16-18.md 28KB
24_statistics.md 27KB
readme7-9.md 25KB
25_pandas.md 24KB
27_python_with_mongodb.md 24KB
readme28-30.md 23KB
readme.md 20KB
04_strings.md 20KB
05_lists.md 19KB
20_python_package_manager.md 17KB
26_python_web.md 17KB
19_file_handling.md 17KB
18_regular_expressions.md 16KB
29_building_API.md 15KB
11_functions.md 14KB
21_classes_and_objects.md 12KB
14_higher_order_functions.md 12KB
03_operators.md 12KB
02_variables_builtin_functions.md 11KB
15_python_type_errors.md 11KB
07_sets.md 11KB
10_loops.md 10KB
12_modules.md 10KB
08_dictionaries.md 10KB
readme22-24.md 9KB
17_exception_handling.md 9KB
28_API.md 8KB
09_conditionals.md 8KB
06_tuples.md 7KB
13_list_comprehension.md 7KB
16_python_datetime.md 7KB
22_web_scraping.md 4KB
23_virtual_environment.md 4KB
30_conclusions.md 2KB
30DaysOfPython_banner3@2x.png 692KB
mongodb-signup-page.png 364KB
vscode.png 284KB
how_to_open_project_on_vscode.png 277KB
opening_project.png 268KB
request_response_header.png 251KB
vscode_ui.png 242KB
mongodb-sandbox.png 234KB
mongodb-create-uri.png 232KB
running_python_script.png 222KB
mongodb-python-driver.png 222KB
mongodb-creating_database.png 221KB
mongodb-free.png 212KB
closing_opened_project.png 189KB
installing_on_macOS.png 188KB
mongodb-cluster-name.png 179KB
mongodb-add-user.png 178KB
help_and_dir_builtin.png 173KB
mongodb-allow-ip-access.png 168KB
get_on_postman.png 157KB
writing_string_on_shell.png 148KB
maths_on_python_shell.png 127KB
helloworld.png 126KB
postman.png 125KB
strftime.png 122KB
builtin-functions_practice.png 119KB
checking_data_types.png 116KB
get_on_browser.png 108KB
try_except.png 106KB
builtin-functional-final.png 89KB
installing_on_windows.png 89KB
indentation.png 85KB
regex.png 83KB
mongodb-register.png 81KB
fixing_syntax_error.png 70KB
builtin-functions.png 68KB
exit_from_shell.png 60KB
invalid_syntax_error.png 59KB
assignmet_operators.png 59KB
python_versio.png 58KB
共 158 条
- 1
- 2
资源评论
prince_zxill
- 粉丝: 1159
- 资源: 220
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功