Lesson#15
Python has very powerful for loop as compared to other programming languages and comes in different flavors. Lets’ discuss them one by one.
Lesson#14
Conditional execution means that execution of certain statements is based on a condition. If a condition comes true, a set of statements is executed otherwise not.
Lesson#13
Control structures are the building blocks that define how a Python program executes. They allow you to control the flow of your program’s logic by making decisions and repeating code blocks.
Lesson#12
Arithmetic operators are used to perform common mathematical operations.
Python has the following arithmetic operators:
Addition: +
Lesson#11
Casting is used in Python to specify data type of a variable or convert data of one data type to another.
Being object-oriented programming language, Python uses classes to define data types. Casting is performed using constructor…
Lesson#10
Variables can store different types of data in Python.
Python has following data types:
Numeric : int, float, complex
Text : str
Boolean : bool
Lesson#9
Python print function is used to print something (text or values of variables) on screen.
x = 10print("x: ", x)# prints x: 10 on screen
Lesson#8
Values are assigned to variables using assignment operator ( = ).
Typical examples of assignment statement are:
x = 100y = "Car"
Lesson#7
Variable is a named memory location where data can be stored. They can also be defined as containers for storing data.
Lesson#6
Writing comments inside the program increases code readability. Python allows us to write comments in programs. Comments can be single-line or multi-lines. Single-line comments starts with # (hash) and multi-line comments starts and ends with ””” (three double…