range() function is introduced in Python3, in Python2 it is xrange(). Range can be used to generate a sequence of numbers. Range will not return…
Loops are block of statements that will be repeatedly executed until the condition is true. Python has 2 types of loops: Type #1: While Loop:…
Conditional statement is used to execute a block of code based on the condition.
Python Tutorial on Strings. Handling quotes. Escape sequences. Immutability.
Previous Next User Input: Input(message) function waits for an input from user. Input function always takes in a string data type value from the user.…
Previous Next Python provides various types of operators. Mathematical Operators: Mathematical operators are used to perform mathematical operations like addition, subtraction, multiplication, division. In addition…
Variable names, function names, class-method names: Use lower case words separated by underscore. Class Name: Each word starts with Capital letter. No Underscore. (Camel Case)…
Python Tutorial – What is a Variable? – How to use Variables in Python – Syntax – Exceptions – Type Error – Examples
Each variable must be categorized into a type of value. Based on the type, the variable will be used for the mathematical or logical operations.…
Spaces and Colons: As we already seen in Python Introduction that Python is basically invented for simplicity and easy of understanding. A well formatted code…