Python is a high level general purpose programming language which has a clear/easy learning curve. Python programming language is massively used in various domains like Artificial Intelligence, Data Science, Web Development, Utilities Tools and Scripts and many more
Python is a Programming language, and the default Python we use is written in C programming language which is also referred to as CPython (Python implementation in C). There are various implementation of Python Programming language i.e Jython(in JAVA), Skulpt(in JS) e.t.c
To make everything easy: We refer CPython as Python
The program's control flow means in which order the program statements get executed. The control flow of the python program is regulated by the different conditional statements, python loops, and function calls.
There are three kinds of Control statements:
This is the default mode of control statement in which the statement of the program is executed in the sequential order that means all the lines of the program are processed line by line. If there are any issues in the middle of the program then complete the source code will be broken.Example
>>>a=10 >>>b=20 >>>c=a+b >>>print(c) 30
In this control statement, Blocks of codes or program statements are executed according to the satisfaction
the condition. This is also called a conditional statement. It includes an if-else statement.
a=3 b=2 if a>b: print("a is greater.") else: print("b is greater.")
a is greater.
In this control statement, the Block of the code is executed repeatedly. Repetition is based on the condition or the within number of iteration. For loops, While loops are the example of repetition statementsExample
a=0 while a<=10: print(a) a+=1
0 1 2 3 4 5 6 7 8 9 10