28.10.2021 Views

Python Tutorial ( PDFDrive )

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Example: .................................................................................................. 52

Parsing Command-Line Arguments: ....................................... 52

getopt.getopt method: .............................................................................. 53

exception getopt.GetoptError: .................................................................. 53

Example ................................................................................................... 53

Python Variable Types ............................................................ 55

Assigning Values to Variables: ................................................................. 55

Multiple Assignment: ................................................................................ 55

Standard Data Types: .............................................................................. 56

Python Numbers: ..................................................................................... 56

Examples: ................................................................................................ 57

Python Strings: ......................................................................................... 57

Python Lists: ............................................................................................. 58

Python Tuples: ......................................................................................... 58

Python Dictionary: .................................................................................... 59

Data Type Conversion: ............................................................................ 59

Python Basic Operators ........................................................... 62

Python Arithmetic Operators: ................................................................... 62

Example: .................................................................................................. 63

Python Comparison Operators: ................................................................ 64

Example: .................................................................................................. 64

Python Assignment Operators: ................................................................ 66

Example: .................................................................................................. 66

Python Bitwise Operators: ........................................................................ 67

Example: .................................................................................................. 68

Python Logical Operators: ........................................................................ 69

Example: .................................................................................................. 69

Python Membership Operators: ............................................................... 70

Example: .................................................................................................. 70

Python Identity Operators: ....................................................................... 71

Example: .................................................................................................. 71

Python Operators Precedence ................................................................. 72

Example: .................................................................................................. 73

Python Decision Making .......................................................... 75

If statements ............................................................................................. 76

Syntax: ..................................................................................................... 76

Flow Diagram: .......................................................................................... 76

Example: .................................................................................................. 76

if...else statements ................................................................................... 77

TUTORIALS POINT

Simply Easy Learning

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!