Python is commonly used for developing websites and software, taskautomation, dataanalysis, and datavisualization
A Python variable is a reservedmemory location to storevalues
For Loop. A forloop in Python is used to iterate over a sequence (list, tuple, set, dictionary, and string). ...
While Loop. The whileloop is used to execute a set of statements as long as a condition is true. ...
Nested Loop.
To write a Python script, use an ordinary plain text file and add Python instructions.
Input() Function. This built-in function reads user input from the keyboard and returns it as a string value.
The print() function prints output on the screen. It can be called with one or more arguments separated by commas.
.py - the extension that indicates it's a python program
In Python, we define a function using the def keyword followed by the name of the function and its parameters inside parentheses.
Python has four basic data types: numbers, strings, lists, and tuples.
Functions allow us to group together related code into reusable blocks. They make our programs easier to read and understand.
Lists are enclosed within square brackets []
Strings are enclosed within single quotes ('') or double quotes ("")
A variable is a container to hold values. In Python, variables are created when they are assigned a value.
A binary number system is one of the four types of number system. In computer applications, where binary numbers are represented by only two symbols or digits, i.e. 0 (zero) and 1(one).
Boolean expressions are the expressions that evaluate a condition and result in a Boolean value i.e true or false. Ex: (a>b && a> c) is a Boolean expression. It evaluates the condition by comparing if 'a' is greater than 'b' and also if 'a' is greater than 'c'.
This little device has a lot of features, like 25 red lights that can flash messages. There are two unprogrammable buttons that can be used to control games. The BBC micro:bit can even detect motion and tell you which direction you're heading in.