Search Header Logo
Introduction To Python - For Loop

Introduction To Python - For Loop

Assessment

Presentation

•

Computers

•

8th Grade

•

Medium

Created by

Ayomikun J Sodipe

Used 4+ times

FREE Resource

40 Slides • 30 Questions

1

media

2

Read Questions & carefully

QUESTIONS AHEAD

3

Match

Match these following words to their meanings

Algorithm

Programming

Python

Sequencing

A step-by-step set of instructions

The process of writing code

A text based programming language

The order in which tasks are performed

4

Multiple Choice

What is variable?

1

A variable is a named storage location that can hold data & values.

2
A variable is a graphical representation of data in a program.
3
A variable is a type of function that performs calculations.
4
A variable is a fixed value that cannot change during program execution.

5

Multiple Choice

To repeat until a particular condition is true use:

1

While loop

2

For loop

3

If loop

4

Indentation

6

Multiple Choice

Python is an example of a:

1

Text-based programming language

2

Visual-based programming language

3

Block-based programming language

4

Language written in JavaScript

7

media

8

media

9

media

10

media

11

media

12

Read Questions & carefully

QUESTIONS AHEAD

13

Match

Match the following Keywords to their meanings

Iteration

Sequence

Syntax

Strings

Variable

Repeating a block of code

Ordered collection of items

Set of rules for writing code

Text (word) data type (within quotes)

Named storage location to store value

14

Multiple Choice

What is a For Loop?

1
A for loop is a method for error handling.
2

A for loop repeats a block of code a specified number of times.

3
A for loop is a type of variable.
4
A for loop is used to define functions.

15

Multiple Choice

True or False.
Lists, Tuples, & Strings are all examples of sequences?

1
False
2
True

16

Match

Match these Symbols to their appropriate Data type & Data Structure, in python

( )

{ }

[ ]

" "

Tuple

Dictionary

List

String

17

media

18

media

19

media

20

media

21

Read Questions & carefully

QUESTIONS AHEAD

22

Multiple Choice

Question image

What will be the output of the following code?

1

Python

2

P

Y

T

H

O

N

3

PYTHON

4

p

y

t

h

o

n

23

Multiple Choice

Question image

What will be the output of the following code?

1

h

e

l

l

o

2

HELLO

3

hello

4

An error occurs.

24

media

25

media

26

media

27

Read Questions & carefully

QUESTIONS AHEAD

28

Multiple Choice

Question image

What will be the output of the following code?

1

Nigeria

Canada

Japan

2

Brazil

Japan

3

Australia

Nigeria

Japan

4

"Nigeria

Canada

Japan"

29

Multiple Choice

Question image

What will be the output of the following code?

1
Art
2

Math

Science

History

3

Literature

Art

4

History

Science

Math

30

media

31

media

32

media

33

Read Questions & carefully

QUESTIONS AHEAD

34

Multiple Choice

Question image

What would this code output?

1
-1
2
3
3
4
4
0 1 2

35

Multiple Choice

Question image

What will be the output of the following code?

1

2 6 8 10 12

2

2

4

6

8

10

3

12

10

8

6

4

2

4

2

4

6

8

10

12

36

Answer Explanation...

This for loop iterates

  • using the range (start, stop, step) function,

  • where: start = 2 → The loop starts at 2.
    stop = 12 →

  • The loop stops before reaching 12 (exclusive).step = 2 →

  • The loop increments i by 2 in each iteration.

37

Multiple Choice

Question image

What will be the output of the following code?

1

10

8

6

4

2

No output.

3

4

6

8

10

4

10

8

6

38

Multiple Choice

Question image

What will be the output of the following code?

1
2
2
5
3
3
4
1 4 9 16 25

39

Multiple Choice

Question image

What will be the output of the following code?

1
Greetings
2
Hello Hello Hello
3

i
i

i

4

3

3

3

40

media

41

media

42

Multiple Choice

Question image

What will be the output of the following code?

1

0 1 2 3

2
1
3

0 1 2

4

1 2 3 4

43

Multiple Choice

Question image

What will be the output of the following code?

1

h e l

2

h

3

h e l l o

4

h e

44

Multiple Choice

Question image

What will be the output of the following code?

1

(0,0) (0,1) (1,0) (1,1) (2,0) (2,1)

2

(0,0) (1,0) (2,0)

3

(0,0) (1,0)

4

(0,1) (1,1) (2,1)

45

media

46

media

47

media

48

media

49

media

50

Read Questions & carefully

QUESTIONS AHEAD

51

Multiple Choice

What is a Dictionary dict () in Python Programming? is a data structure that stores key-value pairs, which allows data to be stored and retrieved

1

A collection of values stored in order, accessible by position

2

A collection of unique values stored without order

3

A fixed sequence of characters used for text processing

4

A data structure that stores key-value pairs, allowing data to stored and found easily

52

Multiple Choice

True or False.

Is Dictionary an examples of sequences?

1
True
2
False

53

media

54

media

55

media

56

media

57

Read Questions & carefully

QUESTIONS AHEAD

58

Multiple Choice

Question image

What will be the output of the following code?

1

John

25

2

John: name

25: age

3

name

age

4

{'name': 'John', 'age': 25}

59

Multiple Choice

Question image

What will be the output of the following code?

1
['Aaron', 'Kai', 'Hamling']
2
dict_values([85, 78, 92])
3
['Aaron', 'Kai']
4
dict_keys(['Aaron', 'Kai', 'Hamling'])

60

Multiple Choice

Question image

What will be the output of the following code?

1
color
2
type
3
price
4
brand model year

61

media

62

media

63

media

64

Read Questions & carefully

QUESTIONS AHEAD

65

Multiple Choice

Question image

What will be the output of the following code?

1

Math

Science

English

2

Math

Science

English

3

90

85

88

4

Grade in Math : 90

Grade in Science : 85

Grade in English : 88

66

Multiple Choice

Question image

What will be the output of the following code?

1

Number of vowels: 4

2

Number of vowels: 3

3

Number of vowels: 5

4

Number of vowels: 6

67

Multiple Choice

Question image

What will be the output of the following code?

1

Alice

2

16

3

Grade not found

4

An error occurs

68

Multiple Choice

What does the term Iteration mean in Python Programming?

1
Iteration is the process of executing a block of code repeatedly using loops.
2
Iteration means creating a new variable in Python.
3
Iteration is the method of importing libraries in Python.
4
Iteration refers to the process of defining a function in Python.

69

Match

Match the following Keywords in Python programming to their meanings

While Loop

Print Function

For Loop

Range

Input function

Used to execute a block of code repeatedly as long as a condition is true

Outputs data to the console or other standard output device

Used to iterate over a sequence (like a list or a string)

Generates a sequence of numbers

Allows user input from the console

70

media
media

Show answer

Auto Play

Slide 1 / 70

SLIDE