Python Archive
Basic functions flow: We define function in python using “def” Function can have n number of statements Function execute only when we call that function. Calling is a single statement used to access the function …
input(): The input() from the user it takes evaluates the expression. In Python automatically identifies whether user entered a string or a number or list. If the input provided is not correct then automatically coming …
Reading input from End-user : input() function is pre-defined. It is used to read input while application is running. It returns the input in String format only We need to convert these String type input …
Character System: File is a collection of bytes. Every symbol occupies 1 byte memory in File. Every symbol stores into memory in binary format. Symbol converts into binary based on its ASCII value. Character system …
ord():Returns the integer for specified symbol. chr(): Return the symbol for specified integer value. Note: To understand the functionality of chr() and ord() functions, we need to know the values of ASCII character set. ASCII …
Operator: Operator is a symbol, to operate operands. Operator performs operations on one or more operands. Operands like variables, constants and functions Python divides the operators in the following way: Arithmetic Operators Comparison (Relational) Operators …
Control statements: Statement is a line of code. Program is a set of statements. Statements execute either sequential or random. Sequential execution from top to bottom in the program. Control statements execute randomly and repeatedly …
If – block: “if” is a keyword. “if” block is used to execute a block only if the condition is valid. We can place the condition directly or with parenthesis Syntax: or Flow Chart: Simple …
If-else block: Else block is used to execute a block of instructions when if block fails. No need to specify condition for else block. “else” block is optional for if-block. Syntax: FlowChart: We can specify …
Nested – If: Defining if block inside another if block. Inner block condition evaluates only when outer condition is valid Simple code: Output it: We can define else block for every nested if block: Number …