Python Basics
Python Basics
Python Basics
Data types
Variables
Expression
String operations
Data types
Data types
Numbers
Strings
Boolean
Numbers
10
11.2
2 + 5j
Number type conversion
int(5.32) 5
float(11) 11.0
complex(10) 10 + 0j
String
"40"
'Hello'
"Hello"
Boolean
Variables
Variables
Variable names are case-sensitive (age, Age and AGE are three different variables)
Expressions
Arithmetic expression
Relational expression
Assignment expression
Logical expression
or
and
not
Identity expression
Membrership expression
String operations
Length of a string
Indexing
string slicing
string concatenation
specified string
Count
number of occurances
of specified string
Capitalize
upper case
Lower
lower case
Replace
specified string.
Replace
replace.
Split
separate strings
Split
specify where to
split
Center
first occurance of
specified string
Find
specified string in
position