Program

Python Program



The definition of a program at its most basic is a sequence of Python statements that have been crafted to do something. 

for example -

print("Hey Programmer")

Above statement prints hello universe on your screen when you run your program, Nothing much.

It is a one-line program and is not particularly useful, but in the strictest definition, it is a Python program. 

We can also make thousand lines of code to solve complex problem.

We make program to solve our problems, we tell computer what to do.

Suppose you wanna convert your text in binary form you have first option just do it by yourself or you can tell to computer to do this by writing some lines of code that would a computer program nothing much.
  

Writing a program

  
When we want to write a program, we use a text editor to write the Python
instructions into a file, which is called a script. By convention, Python scripts
have names that end with .py.

To execute the script, first you have to install python in your conputer to do this  type "python" in your terminal or in cmd or if you have installed it already just run your script,

you have to tell the Python interpreter the name of the file.
In a command window, you would type python hello.py as follows:

python hello.py

(if you saved your file wth another name replace hello.py with that.)

When we want to write a program, we use a text editor to write the Python
instructions into a file, which is called a script. By convention, Python scripts
have names that end with .py , like we have seen it before already.

But in if you don't have pc or laptop and have just android phone you can run your script in phone as well.

Just download python3 from play store and write your program there or run your script.

Post a Comment

0 Comments