Search Header Logo
10.2 Code constructions

10.2 Code constructions

Assessment

Presentation

Computers

8th - 9th Grade

Medium

Created by

John Richards

Used 1+ times

FREE Resource

7 Slides • 30 Questions

1

10.2 Coding Structures

media

2

Key Questions

Can you recall how to create

and use:

  • ​ Data Types

  • ​ Variables

  • ​ Casting

3

Multiple Choice

Which if the values below is an integer data type?

1

1

2

1.0

3

1/2

4

"1"

4

Multiple Choice

_____ data type contain a character (text) such as A, a, Z, z etc.

1

int

2

float

3

char

4

String

5

Multiple Choice

Which if the values below is a float data type?

1

2

2

2.11

3

2/4

4

"2.11"

6

Multiple Choice

Which if the values below return TRUE if executed?

1

10 > 3

2

10 < 3

3

10 >< 3

4

10 <> 3

7

Multiple Choice

"89 / 90"

1

String

2

Integer

3

Float

4

Number

8

Multiple Choice

Conversion of one data type to another e.g.

age = "30" # this is a string!

YearsOld=int(age)


is known as...?

1

Declaring

2

Assigning (or Assignment)

3

Casting

4

Concatenation

9

Multiple Choice

5.23 would be stored as:

1

Integer

2

Real Number

3

String

4

Character

5

Boolean

10

Multiple Choice

a line of text that Python won't try to run as code
1
comment
2
modulo
3
variable
4
boolean

11

Multiple Choice

"The cat sat on the mat" would be stored as:

1

Integer

2

Real Number

3

String

4

Character

5

Boolean

12

Multiple Choice

Arithmetic Operators
What is a / ? 
1
Addition
2
Subtraction
3
Division
4
Modulo

13

Multiple Choice

a data type than can have one of two values: True or False
1
boolean
2
variable
3
modulo
4
interpreter

14

​Variables

15

Multiple Choice

includes numbers and booleans
1
data types
2
whitespace
3
modulo
4
comments

16

Multiple Choice

Comparison Operators
What is < ?
1
Greater than
2
Less than
3
Greater than or equal to
4
Less than or equal to

17

Multiple Choice

What is a variable?
1
A box(memory location) where you store values
2
a type of graphics
3
Data type
4
a type of memory

18

Multiple Choice

Comparision Operators
What is == ? 
1
Equal to 
2
Equal value and equal type
3
Not equal
4
Not equal value or not equal type

19

Multiple Choice

What symbol is used in python to assign values to a variable?
1
equals =
2
plus + 
3
forward slash /
4
asterisk *

20

Multiple Choice

stores a piece of data, and gives it a specific name
1
variable
2
whitespace
3
interpreter
4
modulo

21

​Why are Programming Constructs used?

  • ​Selection

  • ​Sequence

  • ​Iteration

22

Multiple Choice

Iteration that happens a set number of times is known as count-controlled iteration

1

True

2

False

23

Multiple Select

Iteration that repeats until a condition is met is condition-controlled iteration

1

False

2

True

24

Multiple Choice

Execution of statements or functions one after another.

1

Sequence

2

Iteration

3

Selection

4

Branching

25

Multiple Choice

Which of the following does NOT implement iteration?

1

WHILE

2

FOR

3

REPEAT UNTIL

4

IF

26

Multiple Choice

Which keyword is used to immediately terminate a loop
1
break
2
continue
3
stop
4
terminate

27

​Constants

28

Multiple Choice

Question image

What output will the console show, if 15 and 30 are entered by the user?

1

Syntax error

2

The sum of the two numbers - 45

3

The concatenation of the two numbers - 1530

4

Complier error

29

Multiple Choice

Python correct naming convention for constants is?

1

firstName

2

First_Name

3

FIRST_NAME

4

firstname

30

Multiple Choice

Question image

What Data type is TRUE

1

Integer

2

String

3

Boolean

4

Float

31

Multiple Choice

Question image

What is the == on line 1

1

Conditional Operator

2

Assignment

3

Casting

4

String

32

Multiple Choice

Question image

The functions input , print and ________ are used here

1

Choice

2

elif

3

if

4

upper

33

Multiple Choice

Question image

What will be output if someone types Insult

1

You smell funny

2

You look lovely today

3

Invalid response

4

Syntax error

34

Multiple Choice

What keyword is used to define a function? 
1
def
2
if
3
while
4
for

35

Multiple Choice

To obtain the length of a string, you can use which function?
1
length()
2
len()
3
index()
4
length_input()

36

The name ​Python comes from Monty Python

media

​We get the word "Spam" from them too!

37

​When you have finished this click on the link in google classroom and continue your Code Combat adventure from last year (Sign in with Google)

Merry Christmas From Mr Richards!

media

10.2 Coding Structures

media

Show answer

Auto Play

Slide 1 / 37

SLIDE