Skip to main content

Day 1: Introduction to Python | Master Python in 100 Days



Day 1: Introduction to Python

Hello everyone! Welcome to Day 1 of our 100 Days to Learn Python journey! Today, we will start by understanding what Python is, its importance, and how to get started.


What is Python?

  • Python is a popular, high-level programming language that was created by Guido van Rossum and first released in 1991. It’s designed to be easy to read and simple to write, making it perfect for both beginners and advanced programmers. Python allows developers to focus on solving problems rather than worrying about the complex syntax often found in other programming languages.



Why Learn Python?

1. High demand: Many companies need Python programmers.

2. Versatile: You can use Python for web development, data analysis, machine learning, game   development, automation, and more.

3. Great community: There are many resources, forums, and libraries available online.


  





Key Features of Python:

1.Simple and Easy to Learn: Python’s syntax is similar to the English language, making it accessible to new learners.

2.Open Source: Python is free to use, and its source code is openly available to anyone.


3.Cross-Platform: Python works on different platforms like Windows, macOS, Linux, and more.

4.Versatile: It can be used for web development, data analysis, artificial intelligence, machine learning, automation, and more.


5.Large Community and Libraries: Python has a huge community of users, and many libraries are available to make tasks easier, like NumPy for math, TensorFlow for machine learning, and Flask for web apps.

Who Built Python?

  • Python was created by Guido van Rossum in the late 1980s and released in 1991. He named it after the British comedy show “Monty Python’s Flying Circus” which he enjoyed watching. This is why Python has such a fun and approachable feel to it.


Setting Up Python

To start coding in Python, you need to install python on your computer. Here’s how:


1. Visit the Python website: Search for "Python" in your browser to find the official website "https://www.python.org/".

2. Download Python: Choose the latest version suitable for your operating system (Windows, Mac, or Linux).

3. Install Python: Open the downloaded file and follow the instructions to install it.

   

Choosing an IDE

An Integrated Development Environment (IDE) helps you write and run your Python code easily. Here are some popular IDEs you can use:

                                   



1. Visual Studio Code: A powerful and flexible editor for coding.

2. PyCharm: A popular IDE specifically for Python.

3. Jupyter Notebook: Useful for data science and quick coding tests.


You can download these IDEs from their official websites by searching their names in your browser.


Writing Your First Python Program in Different IDEs

Here’s how you can run your first Python program using three different IDEs: Visual Studio Code, PyCharm, and Jupyter Notebook:


 1. Running `hello_world.py` in Visual Studio Code (VS Code)


1.Create a Project Folder: Before you begin, create a folder called `python_work` on your system where you will save your projects. Use lowercase letters and underscores for spaces in the folder name.


2.Open Visual Studio Code: Open VS Code and install the Python extension if you haven’t already. This will help VS Code recognize Python code and provide features like code completion and running Python files.


3.Create a New File: In the `python_work` folder, create a new file and name it `hello_world.py`. You can do this by clicking `File > New File` and then `File > Save As`, naming it `hello_world.py`.


4.Write Your Code: Type the following line of code into the file:

                                print("Hello, Python world!")


5. Run the Program:

  • Open the terminal in VS Code by going to `Terminal > New Terminal`.
  •  In the terminal, type the following command to run your Python file:

                             hello_world.py

  •    You should see the output:

                           Hello, Python world!

 


Optional: You can also press the play button (`Run Python File`) in the top right of the VS Code window to run the file directly.


2. Running `hello_world.py` in PyCharm


1. Create a Project Folder: As with VS Code, create a folder called `python_work` for all your Python projects.


2. Open PyCharm: Launch PyCharm, and select “New Project.” Choose the `python_work` folder as your project directory. Ensure you have the right Python interpreter selected(PyCharm should detect it automatically if Python is installed).


3.Create a New Python File: In your python_work folder within PyCharm, right-click the folder and select New > Python File. Name the file hello_world.py.

4. Write Your Code: Enter the following line of code in your new Python file:

                                         print("Hello, Python world!")


5. Run the Program:

  •  Right-click the `hello_world.py` file and select `Run 'hello_world'`.
  •  You should see the output in the console at the bottom of the PyCharm window:
                                                 Hello, Python world!


 3. Running `hello_world.py` in Jupyter Notebook


1. Install Jupyter Notebook: If you don’t have Jupyter Notebook installed, you can install it using the following command in your terminal:

                                             pip install notebook


2. Create a Project Folder: Create a folder named `python_work` where you will save your projects.


3. Launch Jupyter Notebook: Open your terminal, navigate to the `python_work` folder, and type the following command:

                                                        jupyter notebook

     This will open Jupyter in your web browser.


4. Create a New Notebook: In Jupyter, click on `New` in the top-right corner and select `Python 3 (ipykernel)`.


5. Write Your Code: In the first cell, enter the following code:

                                            print("Hello, Python world!")


6. Run the Program:

  • Click the `Run` button or press `Shift + Enter` to run the code.
  •  You should see the output directly below the cell:

                                                   Hello, Python world!



Thank you for being a part of this journey to learn Python in 100 days! Your interest and desire to learn are very important. I hope you find the tutorials and tips helpful as you move forward. Please share your thoughts, questions, or experiences in the comments below. Let’s learn and grow together!

Happy coding!



Comments

Popular posts from this blog

Day 5: Understanding Variables and Data Types in Python | Master Python in 100 Days

Day 5: Data Types, Variables, and Type Conversion in Python W elcome to Day 5 of our "Master Python in 100 Days" journey! Today, we will explore some of the most important building blocks in Python: data types , variables , and type conversion . Understanding these concepts is essential as they form the basis of how we store and manipulate data in our programs. What are Data Types? Data types tell Python what kind of data we are working with. Python has several built-in data types, and the most common ones are:   1.  Integers (int) : These are whole numbers without decimal points, like 10 , -5 , 0 , etc .   2.  Floats (float) : These are numbers with decimals, like 3.14 , 0.001 , -2.5 .  3. Strings (str) : A string is a collection of characters (letters, numbers, symbols) enclosed in quotes ( " " or ' ' ) . These are used to represent text.  4.  Booleans (bool) :  These are either True or False values. It’s used for logical conditions. Chec...

Day 3: Writing Our First Python Program in Detail | Master Python in 100 Days

Day 3: Writing Our First Python Program in Detail  W elcome back to Master Python in 100 Days ! Today, on Day 3, we are going to write our very first Python program from scratch, step-by-step. This isn’t just about writing code; it’s about understanding every line and making sure we know exactly what’s happening in our program. Let's get started! A Quick Review: What We Did on Day 1 If you remember, on the very first day of the   Master Python in 100 Days , we touched upon how to use the print() function to display basic output on the screen. That was a warm-up , where we gave a quick look at the print() function. But starting from today, we will dive deeper into the actual use of print() . By the end of this session, you’ll not only understand how to use print() properly, but also learn how to avoid common errors and use it in your own Python scripts. So, let’s take our Python learning journey one step further!   Introduction to the print() Function : The ...