+ - 0:00:00
Notes for current slide
Notes for next slide

Variables and Expressions

Introduction to Python

A part of the series at pythonslides.review

Last Updated: 2018-06-13

1 / 32

Prelude: Syntax and Semantics

Syntax: grammar

This is about forming grammatically correct sentences. {{ .Site.Title }}

2 / 32

Prelude: Syntax and Semantics

Syntax: grammar

This is about forming grammatically correct sentences. {{ .Site.Title }}

Harry Sejal love.This is not even a well-formed sentence.

2 / 32

Prelude: Syntax and Semantics

Syntax: grammar

This is about forming grammatically correct sentences. {{ .Site.Title }}

Harry Sejal love.This is not even a well-formed sentence.

Static Semantics: meaning

This is about creating meaningful sentences.

2 / 32

Prelude: Syntax and Semantics

Syntax: grammar

This is about forming grammatically correct sentences. {{ .Site.Title }}

Harry Sejal love.This is not even a well-formed sentence.

Static Semantics: meaning

This is about creating meaningful sentences.

Harry subtracts Sejal.This is a well-formed sentence that is not meaningful.

2 / 32

Prelude: Syntax and Semantics

Syntax: grammar

This is about forming grammatically correct sentences. {{ .Site.Title }}

Harry Sejal love.This is not even a well-formed sentence.

Static Semantics: meaning

This is about creating meaningful sentences.

Harry subtracts Sejal.This is a well-formed sentence that is not meaningful.

Semantics: intent

This is about making sure that the meaning matches with your intent.

2 / 32

Prelude: Syntax and Semantics

Syntax: grammar

This is about forming grammatically correct sentences. {{ .Site.Title }}

Harry Sejal love.This is not even a well-formed sentence.

Static Semantics: meaning

This is about creating meaningful sentences.

Harry subtracts Sejal.This is a well-formed sentence that is not meaningful.

Semantics: intent

This is about making sure that the meaning matches with your intent.

Harry killed Sejal.This is meaningful but wrong!

2 / 32

A typical Python program

statement_1
def function1(...,...):
...
statement_2
statement_3
def function2(...,...):
...
def function3(...,...):
...
statement_4
.
.
.

A collection of statements and functions.

3 / 32

A typical Python program

statement_1
def function1(...,...):
...
statement_2
statement_3
def function2(...,...):
...
def function3(...,...):
...
statement_4
.
.
.

A collection of statements and functions.

Are not required to appear in any particular order, except that a function must be defined before it is called.

3 / 32

Assignment Statements

4 / 32

Assignment Statements

Assign a value to a name.

The left hand side is a name (aka variable).

The right hand side is an expression.

i = 5
j = 2*i
j = 5*j
course_name = "Computing"
course_code = "ES112"

Operations in the expression depend on the types of values being combined.

5 / 32

Assignment Statements

Assign a value to a name.

The left hand side is a name (aka variable).

The right hand side is an expression.

i = 5
j = 2*i
j = 5*j
course_name = "Computing"
course_code = "ES112"

Operations in the expression depend on the types of values being combined.

Eg., Arithmetic operations can be performed on numeric values. Strings can be concatenated.

5 / 32

Types

Numeric Types


6 / 32

Numeric values

Flavors of numbers

  • Integers (type: int)

    • Eg, -3, 5, 450, -9034, 234, 3214
  • Floating Point (type: float)

    • Eg, -3.34, 5.5, 23.4, -63.4, 456.434
7 / 32

Numeric values

Flavors of numbers

  • Integers (type: int)

    • Eg, -3, 5, 450, -9034, 234, 3214
  • Floating Point (type: float)

    • Eg, -3.34, 5.5, 23.4, -63.4, 456.434

int v/s float

  • Floating point numbers break up into the mantissa and the exponent.

    • Eg. .00314159265359 * 10^3
  • Internally, a value is stored as a finite sequence of zeroes and ones.

7 / 32

Operations on Numbers

  • Normal arithmetic operations:

    • addition (+), subtraction (-), multiplication (*), division (/)
8 / 32

Operations on Numbers

  • Normal arithmetic operations:

    • addition (+), subtraction (-), multiplication (*), division (/)

    • modulus or remainder (%), integer division or quotient (//)

8 / 32

Operations on Numbers

  • Normal arithmetic operations:

    • addition (+), subtraction (-), multiplication (*), division (/)

    • modulus or remainder (%), integer division or quotient (//)

    • Exponentiation (**)

8 / 32

Operations on Numbers

  • Normal arithmetic operations:

    • addition (+), subtraction (-), multiplication (*), division (/)

    • modulus or remainder (%), integer division or quotient (//)

    • Exponentiation (**)

    • Python knows that floats generalize ints.

    • In particular, Python allows you to mix ints and floats.

8 / 32

Operations on Numbers

  • Normal arithmetic operations:

    • addition (+), subtraction (-), multiplication (*), division (/)

    • modulus or remainder (%), integer division or quotient (//)

    • Exponentiation (**)

    • Python knows that floats generalize ints.

    • In particular, Python allows you to mix ints and floats.

    • Division always produces floats, even if you are dividing two ints.

8 / 32

Operations on Numbers

  • Normal arithmetic operations:

    • addition (+), subtraction (-), multiplication (*), division (/)

    • modulus or remainder (%), integer division or quotient (//)

    • Exponentiation (**)

    • Python knows that floats generalize ints.

    • In particular, Python allows you to mix ints and floats.

    • Division always produces floats, even if you are dividing two ints.

    • Addition and multiplication works on numbers and sequences.

8 / 32

Operations on Numbers

  • Normal arithmetic operations:

    • addition (+), subtraction (-), multiplication (*), division (/)

    • modulus or remainder (%), integer division or quotient (//)

    • Exponentiation (**)

    • Python knows that floats generalize ints.

    • In particular, Python allows you to mix ints and floats.

    • Division always produces floats, even if you are dividing two ints.

    • Addition and multiplication works on numbers and sequences.

    • Integer division floors the result, instead of rounding towards zero.*

* Even when negative numbers are divided. Here's why.

8 / 32

Operations on Numbers

  • Normal arithmetic operations:

    • addition (+), subtraction (-), multiplication (*), division (/)

    • modulus or remainder (%), integer division or quotient (//)

    • Exponentiation (**)

>>> y = 7//3
>>> print(y)
2
>>> type(y)
<class 'int'>
>>> x = 7/3
>>> print(x)
2.3333333333333335
>>> type(x)
<class 'float'>
9 / 32

Operations on Numbers

  • Fancy arithmetic operations:

    • log(), sqrt(), sin(), ...

    • Built in, but not available by default.

    • import math

>>> help(math.log)
Help on built-in function log in module math:
log(...)
log(x[, base])
Return the logarithm of x to the given base.
If the base not specified, returns the natural logarithm (base e) of x.
10 / 32

Operations on Numbers

  • Fancy arithmetic operations:

    • log(), sqrt(), sin(), ...

    • Built in, but not available by default.

    • import math

>>> help(math.log)
Help on built-in function log in module math:
log(...)
log(x[, base])
Return the logarithm of x to the given base.
If the base not specified, returns the natural logarithm (base e) of x.
>>> math.log(2**5,2)
5.0
>>> int(math.log(2**5,2))
5
10 / 32

Names, Values and Types

Values have types.

Types determine what operations make sense.

11 / 32

Names, Values and Types

Values have types.

Types determine what operations make sense.

Names inherit types from their values.

11 / 32

Names, Values and Types

Values have types.

Types determine what operations make sense.

Names inherit types from their values.

  • In many languages, names are declared along with their type.
11 / 32

Names, Values and Types

Values have types.

Types determine what operations make sense.

Names inherit types from their values.

  • In many languages, names are declared along with their type.

  • Python takes the responsibility of making a best guess.

11 / 32

Names, Values and Types

Values have types.

Types determine what operations make sense.

Names inherit types from their values.

  • In many languages, names are declared along with their type.

  • Python takes the responsibility of making a best guess.

  • The type of a name is not fixed explicitly in advance.
11 / 32

Names, Values and Types

Values have types.

Types determine what operations make sense.

Names inherit types from their values.

  • In many languages, names are declared along with their type.

  • Python takes the responsibility of making a best guess.

  • The type of a name is not fixed explicitly in advance.
  • Even worse,...
11 / 32

🤕 Changing Types

It is possible for names to be assigned values of different types as the program evolves.

12 / 32

🤕 Changing Types

It is possible for names to be assigned values of different types as the program evolves.

i = 5 #i is an int
12 / 32

🤕 Changing Types

It is possible for names to be assigned values of different types as the program evolves.

i = 5 #i is an int
i = 234**2 #still an int...
12 / 32

🤕 Changing Types

It is possible for names to be assigned values of different types as the program evolves.

i = 5 #i is an int
i = 234**2 #still an int...
j = i/7 #j is float, creats a float
12 / 32

🤕 Changing Types

It is possible for names to be assigned values of different types as the program evolves.

i = 5 #i is an int
i = 234**2 #still an int...
j = i/7 #j is float, creats a float
.
.
.
12 / 32

🤕 Changing Types

It is possible for names to be assigned values of different types as the program evolves.

i = 5 #i is an int
i = 234**2 #still an int...
j = i/7 #j is float, creats a float
.
.
.
i = 2*j #i is now a float! ☠
12 / 32

🤕 Changing Types

It is possible for names to be assigned values of different types as the program evolves.

i = 5 #i is an int
i = 234**2 #still an int...
j = i/7 #j is float, creats a float
.
.
.
i = 2*j #i is now a float! ☠

This is not recommended: it is confusing and leads to debugging nightmares.

12 / 32

🤕 Changing Types

It is possible for names to be assigned values of different types as the program evolves.

i = 5 #i is an int
i = 234**2 #still an int...
j = i/7 #j is float, creats a float
.
.
.
i = 2*j #i is now a float! ☠

This is not recommended: it is confusing and leads to debugging nightmares.

Use consistent naming conventions.

12 / 32

Types

Boolean Types


13 / 32

Boolean Types




True, False

>>> type(True)
<class 'bool'>
>>> type(False)
<class 'bool'>
14 / 32

Boolean Types




True, False

>>> type(True)
<class 'bool'>
>>> type(False)
<class 'bool'>

Logical Operators: not, and, or

  • not True is False and not False is True
>>> not True
False
>>> not False
True
15 / 32

Boolean Types




True, False

>>> type(True)
<class 'bool'>
>>> type(False)
<class 'bool'>

Logical Operators: not, and, or

  • and is the logical AND:
    outputs True exactly when both inputs are True.
>>> True and True
True
>>> True and False
False
>>> False and True
False
>>> False and False
False
16 / 32

Boolean Types




True, False

>>> type(True)
<class 'bool'>
>>> type(False)
<class 'bool'>

Logical Operators: not, and, or

  • and is the logical OR:
    outputs False exactly when both inputs are False.
>>> True or True
True
>>> True or False
True
>>> False or True
True
>>> False or False
False
17 / 32

Comparison Operators

  • Equality (==), Not Equals (!=)

  • Greater than or equal to (>=), Less than or equal to (<=)

  • Greater Than (>), Less than (<)

>>> x = 3
>>> y = 3.0
18 / 32

Comparison Operators

  • Equality (==), Not Equals (!=)

  • Greater than or equal to (>=), Less than or equal to (<=)

  • Greater Than (>), Less than (<)

>>> x = 3
>>> y = 3.0
>>> x == y
18 / 32

Comparison Operators

  • Equality (==), Not Equals (!=)

  • Greater than or equal to (>=), Less than or equal to (<=)

  • Greater Than (>), Less than (<)

>>> x = 3
>>> y = 3.0
>>> x == y
True
18 / 32

Comparison Operators

  • Equality (==), Not Equals (!=)

  • Greater than or equal to (>=), Less than or equal to (<=)

  • Greater Than (>), Less than (<)

>>> x = 3
>>> y = 3.0
>>> x == y
True
>>> type(x) == type(y)
18 / 32

Comparison Operators

  • Equality (==), Not Equals (!=)

  • Greater than or equal to (>=), Less than or equal to (<=)

  • Greater Than (>), Less than (<)

>>> x = 3
>>> y = 3.0
>>> x == y
True
>>> type(x) == type(y)
False
18 / 32

Comparison Operators

  • Equality (==), Not Equals (!=)

  • Greater than or equal to (>=), Less than or equal to (<=)

  • Greater Than (>), Less than (<)

>>> x = 3
>>> y = 3.0
>>> x == y
True
>>> type(x) == type(y)
False
>>> True < False
False
18 / 32

Precedence

Who Comes First


19 / 32

Exponentiation

The expression:

a**p/q

has two possible interpretations:

a**p/q v/s a**p/q

Similarly,

-a**b

has two possible interpretations:

-a**b v/s -a**b

20 / 32

From the Manual...

help('**')

The power operator binds more tightly than unary operators on its left; it binds less tightly than unary operators on its right.

21 / 32

From the Manual...

help('**')

The power operator binds more tightly than unary operators on its left; it binds less tightly than unary operators on its right.

For int operands, the result has the same type as the operands unless the second argument is negative. In that case, all arguments are converted to float and a float result is delivered.

21 / 32

From the Manual...

help('**')

The power operator binds more tightly than unary operators on its left; it binds less tightly than unary operators on its right.

For int operands, the result has the same type as the operands unless the second argument is negative. In that case, all arguments are converted to float and a float result is delivered.

For example, "10**2" returns "100", but "10**-2" returns "0.01".

21 / 32

From the Manual...

help('**')

The power operator binds more tightly than unary operators on its left; it binds less tightly than unary operators on its right.

For int operands, the result has the same type as the operands unless the second argument is negative. In that case, all arguments are converted to float and a float result is delivered.

For example, "10**2" returns "100", but "10**-2" returns "0.01".

Raising "0.0" to a negative power results in a "ZeroDivisionError".

21 / 32

From the Manual...

help('**')

The power operator binds more tightly than unary operators on its left; it binds less tightly than unary operators on its right.

For int operands, the result has the same type as the operands unless the second argument is negative. In that case, all arguments are converted to float and a float result is delivered.

For example, "10**2" returns "100", but "10**-2" returns "0.01".

Raising "0.0" to a negative power results in a "ZeroDivisionError".

Raising a negative number to a fractional power results in a "complex" number. (In earlier versions it raised a "ValueError".)

21 / 32

Examples

>>> (4**12)/2
22 / 32

Examples

>>> (4**12)/2
8388608.0
22 / 32

Examples

>>> (4**12)/2
8388608.0
>>> 4**(12/2)
22 / 32

Examples

>>> (4**12)/2
8388608.0
>>> 4**(12/2)
4096.0
22 / 32

Examples

>>> (4**12)/2
8388608.0
>>> 4**(12/2)
4096.0
>>> 4**12/2
22 / 32

Examples

>>> (4**12)/2
8388608.0
>>> 4**(12/2)
4096.0
>>> 4**12/2
8388608.0
22 / 32

Examples

>>> (4**12)/2
8388608.0
>>> 4**(12/2)
4096.0
>>> 4**12/2
8388608.0
>>> 10**-2
22 / 32

Examples

>>> (4**12)/2
8388608.0
>>> 4**(12/2)
4096.0
>>> 4**12/2
8388608.0
>>> 10**-2
0.01
22 / 32

Examples

>>> (4**12)/2
8388608.0
>>> 4**(12/2)
4096.0
>>> 4**12/2
8388608.0
>>> 10**-2
0.01
>>> -10**2
22 / 32

Examples

>>> (4**12)/2
8388608.0
>>> 4**(12/2)
4096.0
>>> 4**12/2
8388608.0
>>> 10**-2
0.01
>>> -10**2
-100
22 / 32

Comparisons

if a == 3 or b == 3 or c == 3:

V/S.

if a or b or c == 3:
23 / 32

Comparisons

if a == 3 or b == 3 or c == 3:

V/S.

if a or b or c == 3:

Since OR has a lower precedence than ==, the second statement will be evaluated as:

(X) if a or b or c == 3:

23 / 32

Comparisons

if a == 3 or b == 3 or c == 3:

V/S.

if a or b or c == 3:

Since OR has a lower precedence than ==, the second statement will be evaluated as:

(X) if a or b or c == 3:

which is very different from:

(Y) if a == 3 or b == 3 or c == 3:

23 / 32

Comparisons

if a == 3 or b == 3 or c == 3:

V/S.

if a or b or c == 3:

Since OR has a lower precedence than ==, the second statement will be evaluated as:

(X) if a or b or c == 3:

which is very different from:

(Y) if a == 3 or b == 3 or c == 3:

💀 Note that there are values of a,b,c for which X will evaluate to True while Y will evaluate to False.

23 / 32

The Precedence Table 😴

ifelse Conditional expression
or Boolean OR
and Boolean AND
not x Boolean NOT
in, not in, is, is not, <, <=, >, >=, !=, == Comparisons, including membership tests and identity tests
| Bitwise OR
^ Bitwise XOR
& Bitwise AND
<<, >> Shifts
+, - Addition and subtraction
*, @, /, //, % Multiplication, matrix multiplication division, remainder [5]
+x, -x, ~x Positive, negative, bitwise NOT
** Exponentiation [6]
24 / 32

Strings

Crunching Text Data


25 / 32

Manipulating Text

  • Computation is a lot more than number crunching.
26 / 32

Manipulating Text

  • Computation is a lot more than number crunching.

  • Text processing is increasingly important.

26 / 32

Manipulating Text

  • Computation is a lot more than number crunching.

  • Text processing is increasingly important.

    • Document preparation

    • Importing/exporting spreadsheet data.

    • Maching queries to content.

26 / 32

Manipulating Text

  • Computation is a lot more than number crunching.

  • Text processing is increasingly important.

    • Document preparation

    • Importing/exporting spreadsheet data.

    • Maching queries to content.

String Types

26 / 32

Manipulating Text

  • Computation is a lot more than number crunching.

  • Text processing is increasingly important.

    • Document preparation

    • Importing/exporting spreadsheet data.

    • Maching queries to content.

String Types

  • Type string str, a sequence of characters.
26 / 32

Manipulating Text

  • Computation is a lot more than number crunching.

  • Text processing is increasingly important.

    • Document preparation

    • Importing/exporting spreadsheet data.

    • Maching queries to content.

String Types

  • Type string str, a sequence of characters.

    • A single character is a string of length one.

    • No separate char type.

26 / 32
27 / 32

String Types (Contd.)

  • Enclose in quotes: single, double or triple.
27 / 32

String Types (Contd.)

  • Enclose in quotes: single, double or triple.
s = "ES112 Computing"
27 / 32

String Types (Contd.)

  • Enclose in quotes: single, double or triple.
s = "ES112 Computing"
>>> w = 'ES112 'Computing''
File "<stdin>", line 1
w = 'ES112 'Computing''
^
SyntaxError: invalid syntax
27 / 32

String Types (Contd.)

  • Enclose in quotes: single, double or triple.
s = "ES112 Computing"
>>> w = 'ES112 'Computing''
File "<stdin>", line 1
w = 'ES112 'Computing''
^
SyntaxError: invalid syntax
w = 'ES112 \'Computing\''
x = "ES112 'Computing'"
27 / 32

String Types (Contd.)

  • Enclose in quotes: single, double or triple.
s = "ES112 Computing"
>>> w = 'ES112 'Computing''
File "<stdin>", line 1
w = 'ES112 'Computing''
^
SyntaxError: invalid syntax
w = 'ES112 \'Computing\''
x = "ES112 'Computing'"
>>> y = "Students say that "ES112 Computing" is their favorite course."

SyntaxError: invalid syntax

27 / 32

String Types (Contd.)

  • Enclose in quotes: single, double or triple.
s = "ES112 Computing"
>>> w = 'ES112 'Computing''
File "<stdin>", line 1
w = 'ES112 'Computing''
^
SyntaxError: invalid syntax
w = 'ES112 \'Computing\''
x = "ES112 'Computing'"
>>> y = "Students say that "ES112 Computing" is their favorite course."

SyntaxError: invalid syntax

z = '''Students say that "ES112 Computing" is their favorite course.'''
27 / 32

Strings as Sequences

28 / 32

Strings as Sequences

  • Strings in Python are a sequence or list of characters.
28 / 32

Strings as Sequences

  • Strings in Python are a sequence or list of characters.

  • Positions 0, 1, ..., n-1 for a string of length n

28 / 32

Strings as Sequences

  • Strings in Python are a sequence or list of characters.

  • Positions 0, 1, ..., n-1 for a string of length n

  • Positions -1, -2, ... count backwards from the end.

28 / 32
>>> s = "hello world"
29 / 32
>>> s = "hello world"
>>> s[0]
29 / 32
>>> s = "hello world"
>>> s[0]
'h'
29 / 32
>>> s = "hello world"
>>> s[0]
'h'
>>> s[-1]
29 / 32
>>> s = "hello world"
>>> s[0]
'h'
>>> s[-1]
'd'
29 / 32
>>> s = "hello world"
>>> s[0]
'h'
>>> s[-1]
'd'
>>> len(s)
29 / 32
>>> s = "hello world"
>>> s[0]
'h'
>>> s[-1]
'd'
>>> len(s)
11
29 / 32
>>> s = "hello world"
>>> s[0]
'h'
>>> s[-1]
'd'
>>> len(s)
11
>>> s[0:len(s)]
29 / 32
>>> s = "hello world"
>>> s[0]
'h'
>>> s[-1]
'd'
>>> len(s)
11
>>> s[0:len(s)]
'hello world'
29 / 32
>>> s = "hello world"
>>> s[0]
'h'
>>> s[-1]
'd'
>>> len(s)
11
>>> s[0:len(s)]
'hello world'
>>> s[3:7]
29 / 32
>>> s = "hello world"
>>> s[0]
'h'
>>> s[-1]
'd'
>>> len(s)
11
>>> s[0:len(s)]
'hello world'
>>> s[3:7]
'lo w'
29 / 32

String Operators

Concatenation via + and Slicing via :

30 / 32

String Operators

Concatenation via + and Slicing via :

For strings s and w, s + w is sw.

30 / 32

String Operators

Concatenation via + and Slicing via :

For strings s and w, s + w is sw.

A slice is a segment of a string.

30 / 32

String Operators

Concatenation via + and Slicing via :

For strings s and w, s + w is sw.

A slice is a segment of a string.

s[i:j] starts at s[i] and ends at s[j-1].

30 / 32

String Operators

Concatenation via + and Slicing via :

For strings s and w, s + w is sw.

A slice is a segment of a string.

s[i:j] starts at s[i] and ends at s[j-1].

>>> s = "hello"
>>> w = "world"
>>> s + w
30 / 32

String Operators

Concatenation via + and Slicing via :

For strings s and w, s + w is sw.

A slice is a segment of a string.

s[i:j] starts at s[i] and ends at s[j-1].

>>> s = "hello"
>>> w = "world"
>>> s + w
'helloworld'
30 / 32

String Operators

Concatenation via + and Slicing via :

For strings s and w, s + w is sw.

A slice is a segment of a string.

s[i:j] starts at s[i] and ends at s[j-1].

>>> s = "hello"
>>> w = "world"
>>> s + w
'helloworld'
>>> s + ' ' + w
30 / 32

String Operators

Concatenation via + and Slicing via :

For strings s and w, s + w is sw.

A slice is a segment of a string.

s[i:j] starts at s[i] and ends at s[j-1].

>>> s = "hello"
>>> w = "world"
>>> s + w
'helloworld'
>>> s + ' ' + w
'hello world'
30 / 32

String Operators

Concatenation via + and Slicing via :

31 / 32

String Operators

Concatenation via + and Slicing via :

>>> x = "hello world"
>>> x[0:5] + x[5:]
31 / 32

String Operators

Concatenation via + and Slicing via :

>>> x = "hello world"
>>> x[0:5] + x[5:]
'hello world'
>>> x = "hello world"
>>> x[0:5] + x[5:0]
31 / 32

String Operators

Concatenation via + and Slicing via :

>>> x = "hello world"
>>> x[0:5] + x[5:]
'hello world'
>>> x = "hello world"
>>> x[0:5] + x[5:0]
'hello worl'
31 / 32

String Operators

Concatenation via + and Slicing via :

>>> x = "hello world"
>>> x[0:5] + x[5:]
'hello world'
>>> x = "hello world"
>>> x[0:5] + x[5:0]
'hello worl'
>>> x = "hello world"
>>> x[5]
31 / 32

String Operators

Concatenation via + and Slicing via :

>>> x = "hello world"
>>> x[0:5] + x[5:]
'hello world'
>>> x = "hello world"
>>> x[0:5] + x[5:0]
'hello worl'
>>> x = "hello world"
>>> x[5]
' '
31 / 32

🎉

32 / 32

Prelude: Syntax and Semantics

Syntax: grammar

This is about forming grammatically correct sentences. {{ .Site.Title }}

2 / 32
Paused

Help

Keyboard shortcuts

, , Pg Up, k Go to previous slide
, , Pg Dn, Space, j Go to next slide
Home Go to first slide
End Go to last slide
Number + Return Go to specific slide
b / m / f Toggle blackout / mirrored / fullscreen mode
c Clone slideshow
p Toggle presenter mode
t Restart the presentation timer
?, h Toggle this help
Esc Back to slideshow