How to write a python script

image by Alexandra_Koch

So far we executed simple Python statements and simple python functions. A program is usually a text file saved in the permanent(secondary) memory. It is called a script or module. We can write a script using the Python IDLE. We can write a script using a text editor like notepad. We can write a script using an IDE like PyCharm or VSCode.

Steps 

Create a new file in the IDLE.

Add the following code and save as a python file.

Run the module.
watch video

Comments => #File: my_first_script.py
function definition => def main():
define a Variable => x= eval(input("Enter a number between 0 and 1: "))
Loop and the body of the loop => 
for i in range(10): 
x = x+1 
print(x)
function call=> main()