Posts

Showing posts from March, 2021

Python if....elif....else statements

Image
python if... Statements:                python if..  statement is used for decision making operation.      It contains the body of code which will run only when the conditions given in the if statement is true if only ---- when condition True : if.. flowchart Example: #if only ------ condition true x = 100 y = 50 if x > y: print ( "greater then y" ) print ( "condition true" ) Output: greater then y condition true                In this example we have two variable x=100,y=50 and we create if expression [if x > y:] then we give statement [print("greater then y")]    if condition expression is true then statement is pass .then outside of if statement print will be execute. if only ---- when condition False:               I n this example we have two variable x=100,y=50 and we create if expression [if x < ...

DATA TYPES IN PYTHON

Image
 Data types in python          S tring          I nteger          F loat          C omplex          L ist          T uple          R ange          D ictionary          S et           B oolean String:                     strings are using single quotation, double quotation and three quotation. Example: #string x= "codeco" print ( type (x)) Output : <class 'str'> Integer:                    I nteger is a numeric type Example: #integer x= 232323 print ( type (x)) Output: <class 'int'> Float:               I t is similar to integer datatype but with decimal values. Exampl...