Python Basics
- Introduction to Python
- Installing Python in Windows
- Python Values, Variables and Types
- Python Variable Names and Keywords
- Python Statements
- Python Operators and Expressions
- Take input from User in Python
- Python Comments
- Python Conditional Execution
- Python Functions
- Python Loops
- Python Strings
- Python Lists
- Python Dictionaries
Installing Python in Windows
Please download and install Python 3.x from:
http://www.python.org/download/
When the download is completed, double-click the file and follow the instructions to install it. Now you can write your first python program using either approach 1 or approach 2 described below.
Approach 1:
When Python is installed, a program called IDLE is also installed along with it. It provides graphical user interface to work with Python.
- Open IDLE, copy the following code below and press enter.
print("Hello, Python!")
- To create a file in IDLE, go to File > New Window (Shortcut: Ctrl+N).
Write Python code and save (Shortcut: Ctrl+S) with .py file extension like: hello_python.py or my_first_python_program.pyprint("Hello, World!")
- Go to Run > Run module (Shortcut: F5) and you can see the output. Congratulations, you’ve successfully run your first Python program.
Approach 2:
1. Install the Atom Text Editor in your system. You can download and install Atom from this site:
https://atom.io/
After successfully installation you will get a window like this:
2. Now click the File tab to create a new file. Type the below code and save it as .py file. for example you can give a name like first.py
print("Hello Make Me Analyst!!")
3. Open command prompt. Go to the the folder using cd command where you stored first.py file. and type python first.py to run your first program.
Approach 3:
You can run your python code from here just using your browser. No installation required.
Try it Yourself
Paste the below code into the command prompt and click run.
print("Hello Make Me Analyst!!!")