Lecture 6: Flow Control
Lecture 6: Flow Control 1 / 28
Lecture 6: Flow Control Lecture 6: Flow Control 1 / 28 Relational - - PowerPoint PPT Presentation
Lecture 6: Flow Control Lecture 6: Flow Control 1 / 28 Relational Expressions Conditions in if statements use expressions that are conceptually either true or false . These expressions are called relational expressions or Boolean expressions
Lecture 6: Flow Control 1 / 28
Lecture 6: Flow Control 2 / 28
Lecture 6: Flow Control 3 / 28
Lecture 6: Flow Control 4 / 28
Lecture 6: Flow Control 5 / 28
1 >
2 >
3
4
5
1 >
2
3
4 1 >
2
3
4
Lecture 6: Flow Control 6 / 28
1 >
2
3
4 >
5
6
7
8 >
9
10
Lecture 6: Flow Control 7 / 28
1 >
2
3
4 >
5
6
1 >
2
Lecture 6: Flow Control 8 / 28
1 >
2
3
4 >
5
6
Lecture 6: Flow Control 9 / 28
1 >
2
3
4 >
5
6
7 >
8
9
Lecture 6: Flow Control 10 / 28
1 Write a function sum_primes that takes as input a vector or matrix
2 Write a function clean_data that takes as input a vector and
Lecture 6: Flow Control 11 / 28
Lecture 6: Flow Control 12 / 28
Lecture 6: Flow Control 13 / 28
1
2
3
4
5
6
7 8
9
10
11
12
13
14
Lecture 6: Flow Control 14 / 28
1
2
3
4
5
6
7
8
9
10
11
Lecture 6: Flow Control 15 / 28
1
2
3
4
5
6
7
8
9
Lecture 6: Flow Control 16 / 28
Lecture 6: Flow Control 17 / 28
Lecture 6: Flow Control 18 / 28
Lecture 6: Flow Control 19 / 28
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Lecture 6: Flow Control 20 / 28
Lecture 6: Flow Control 21 / 28
1
2
3
4
5
6
7 8
9
10
11
12
13
14
15
16
Lecture 6: Flow Control 22 / 28
1
2
3
4
5
6
7
8
9
10 11
≤m) 12
13
≤n) 14
15
16
17
18
19
Lecture 6: Flow Control 23 / 28
1
2
3
4
5
6
7 8
9
10
11
12
13
14
Lecture 6: Flow Control 24 / 28
Lecture 6: Flow Control 25 / 28
Lecture 6: Flow Control 26 / 28
1
2
3 4
5
6
7 8
9
10
11
12
Lecture 6: Flow Control 27 / 28
1
Lecture 6: Flow Control 28 / 28