bluehost

Thursday, 20 May 2021

Control Flow Tools In Python.

If statement.
is one of the known statements. It is always followed by "elif" a short form of else if, and or "else".

Example
The answer to this should be " more" simply because "x" is more than 0 and 1.

For statement.
Unlike in some other languages like C and Pascal the pythons for statement iterates over the items of any sequence  .ie a list or a string.


The range() Function.
The range() function generates the arithmetic progression. For example, the range(7) will generate seven values and since the counting starts from zero(0), it will count from zero to six.

The Continue statement.
The continued statement makes the program go with the next iteration of the loop after finishing the first one.

No comments:

Post a Comment

React vs Angular; Front-End Web Development

Angular and React  are two of the most popular Javascript tools for front-end development. React is a Javascript created by Meta...