# Expression Reference

How to represent the different kinds of Python expressions as Expression Trees

### Operations

#### Boolean Operation - and

##### Specification
Operations

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

#### Boolean Operation - or

##### Specification
Operations

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

#### Boolean Operation - sequence of and

##### Specification
Operations

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

#### Boolean Operation - mixing and & or

##### Specification
Operations

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

#### Named Expression aka Walrus Operator

##### Specification
Operations

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

#### Binary Operation - sum

##### Specification
Operations

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

#### Binary Operation - difference

##### Specification
Operations

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

#### Binary Operation - multiplication

##### Specification
Operations

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

#### Binary Operation - division

##### Specification
Operations

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

#### Binary Operation - floor division

##### Specification
Operations

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

#### Binary Operation - modulo

##### Specification
Operations

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

#### Binary Operation - exponentiation

##### Specification
Operations

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

#### Binary Operation - bitwise shift left

##### Specification
Operations

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

#### Binary Operation - bitwise shift right

##### Specification
Operations

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

#### Binary Operation - bitwise or

##### Specification
Operations

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

#### Binary Operation - bitwise xor

##### Specification
Operations

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

#### Binary Operation - bitwise and

##### Specification
Operations

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

#### Binary Operation - 2 consecutive operations

##### Specification
Operations

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

#### Unary Operation - unary positive

##### Specification
Operations

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

#### Unary Operation - unary negation

##### Specification
Operations

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

#### Unary Operation - bitwise negation

##### Specification
Operations

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

### Functions

#### Lambda - one parameter

##### Specification
lambda

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

#### Call expression

##### Specification
function

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

### Lambda

#### Lambda - no parameters

##### Specification
Lambda

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

#### Lambda - full parameters kind

##### Specification
Lambda

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

### Generics

#### If Expression

##### Specification
conditionals

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

### Collections

#### List - one element

##### Specification
collections

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

#### List - no elements

##### Specification
collections

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

#### List - multiple elements

##### Specification
collections

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

#### Tuple - one element

##### Specification
collections

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

#### Tuple - no elements

##### Specification
collections

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

#### Tuple - multiple elements

##### Specification
collections

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

#### Dictionary - one element

##### Specification
collections

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

#### Dictionary - no elements

##### Specification
collections

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

#### Dictionary - one kwarg argument

##### Specification
collections

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

#### Dictionary - multiple arguments

##### Specification
collections

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

#### Set - one element

##### Specification
collections

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

#### Set - multiple elements

##### Specification
collections

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

### Comprehension

#### List Comprehension - one generator

##### Specification
comprehension

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

#### List Comprehension - generators and filters

##### Specification
comprehension

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

#### Set Comprehension - one generator

##### Specification
comprehension

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

#### Dictionary Comprehension - one generator

##### Specification
comprehension

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

#### Generator Expression - one generator

##### Specification
comprehension

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

### Keyword

#### Await expression

##### Specification
keyword

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

#### Yield expression

##### Specification
keyword

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

#### Yield From expression

##### Specification
keyword

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

### Comparison

#### Compare - equality

##### Specification
compare

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

#### Compare - difference

##### Specification
compare

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

#### Compare - less than

##### Specification
compare

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

#### Compare - less than or equal to

##### Specification
compare

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

#### Compare - greater than

##### Specification
compare

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

#### Compare - greater than or equal to

##### Specification
compare

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

#### Compare - identity equality operator

##### Specification
compare

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

#### Compare - identity difference operator

##### Specification
compare

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

#### Compare - 'in' membership operator

##### Specification
compare

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

#### Compare expression using the 'not in' membership operator to test if a sequence is not present in an object

##### Specification
compare

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

### Constant

#### Constant expression

##### Specification
constant

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

##### Specification
constant

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

### Attribute

#### Attribute

##### Specification
attribute

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

### Subscript

#### Subscript expression

##### Specification
subscript

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

#### Sliced Subscription

##### Specification
slice

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

### Name

#### Name expression

##### Specification
name

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

### f-string

#### Formatted String - no formatted value

##### Specification
formatted string

Given the following snippet of code:

The Expression Tree for the highlighted expression is:

#### Formatted String - single formatted value

##### Specification
formatted string

Given the following snippet of code:

The Expression Tree for the highlighted expression is: