Skip to main content

Installing Python




Python is free to use, so anybody can download the python application for execution of program. You can download the latest version of python application from www.python.org. If this python executable file doesn’t install in you system then you can download Anaconda application for executing the python code.

You have two mode or options for writing the code in python
      a) Interactive mode
      b) Scripting mode
  • In an interactive mode you can run only single line or one block of code. It runs very quickly and gives the result instantly.
  • Script mode is used when the user needs to write more than one line or block of code. It takes more time to compile. In this mode, one can simply write all the lines of code in a text file, but you have to save that file with .py extension.


Python programs must be written in a specific structure. The syntax must be correct or the interpreter will generate error message and won’t execute the program.

Interactive Mode – To execute the program in this mode follow the below step
Click on Start Menu à All Programs à Python 3.7
After opening the application we will print our name or some specific text, you have to write:
print(“Hello World”)
on the python prompt. It is identified by three greater than sign(>>>). 

You can see the printed text on the next line i.e. Hello World in the next line, that is the output of the written code.
Scripting mode – To write the program in this mode follow the below step
Step 1 – Open Notepad and save that file with .py extension name. Eg. abc.py, first.py, etc
Step 2 – Open Command prompt from start menu, go to the folder where you have kept your python file and write:
python first.py
Where Python is the keyword for executing python file and first.py is my python file name.
In the above image I have made a python script file with first.py name. In this I have made a program to calculate area and circumference of a circle. I have saved this file on desktop. Follow the below step to execute the code.
Step 1 – cd\
Step 2 – cd users
Step 3 – cd Aasif (This is user name of my computer, you will have to check yours by clicking on start menu and on the top you can see your computer user name)
Step 4 – cd desktop
Step 5 – python first.py
Write the below code in first.py file

Podcast Link: Click Here
YouTube Video Link: Click
Execution of Python Program click on the YouTube link: Click Here
adsterra

Comments

Popular posts from this blog

Q & A Chapter 1 | Internet Basics | Class 10 CBSE | Computer Application

 Q & A of Chapter 1 Internet Basics A. Tick the correct options – 1. (b) TCP/IP 2. (a) Internet Service Provider 3. (a) URL 4. (b) HTTP 5. (a) Bridge 6. (a) home page 7. (d) All of these 8. (b) Domain Naming System 9. (b) Rules 10. (d) ARPANET B. Very Short Answer Type Questions – 1. In the URL http://www.myfirm.co.in/about.html , what do the following components depict? (a) http                                                 (b) in (a) Http represents a type of server and the protocol on the Internet (b) ‘in’ represents the domain extension of the website. 2. In the URL http://www.favmusic.com/contactus.html what does www.favmusic stand for? www.favmusic represents the domain name i.e. favmusic in www. 3. W...

Create Composite Key in SQL

What is a composite key? A composite key in SQL can be defined as  a combination of multiple columns , which are used to identify all the rows involved uniquely. Even though a single column can't identify any row uniquely, a combination of over one column can uniquely specify any record. How to create a composite key? EG: