Skip to main content

python for quantum (datascience) by maaz

Variables 

In [ ]:

Arithmetic operators 

Basic operators 

In [ ]:

Integer division and modulus operators 

In [ ]:

Exponent operator

number**exponent
In [ ]:

Objects 

Lists 

In [ ]:

Tuple 

In [ ]:

Dictionary 

In [ ]:

List of the other objects or variables 

In [ ]:

Size of an object 

We use the method "len()" that takes an object as the input.
In [ ]:

Loops 

While-loop 

In [ ]:

For-loop 

In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:

Conditionals 

In [ ]:

Logical and Boolean operators

Logical operator "and"

In [ ]:

Logical operator "or"

In [ ]:

Logical operator "not" 

In [ ]:

Operator "equal to" 

In [ ]:

Operator "not equal to" 

In [ ]:

Operator "less than or equal to" 

In [ ]:

Operator "greater than or equal to" 

In [ ]:

Double list 

In [ ]:

List operations

Concatenation of two lists 

In [ ]:

Appending a new element 

In [ ]:

Functions

In [ ]:

Random number

We can use method "randrange()".
In [ ]:

Comments

Popular posts from this blog