wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

PROG3 - Chapter 1

Total questions: 64

Worksheet time: 36mins

Name
Class
Date
1.

Python Is a high-level, interpreted, _______, and object-oriented ________.

a)

interactive

b)

scripting language

c)

programming language

2.

 The uses of Python are:

a)

Web development

b)

Data science

c)

Creating software prototypes

d)

Creating web prototypes

3.

Python is designed to be highly readable.

a)

True

b)

False

4.

Python uses __________ keywords frequently whereas other languages use _________.

It also has fewer syntactical constructions than other languages.

a)

English

b)

Tagalog

c)

Chinese

d)

punctuation

e)

commas

5.

Creator of Python.

Born in 1956 in Haarlem, the Netherlands.

a)

Guido van Rossum

b)

Gudo van Roshum

c)

Gido van Rosum

6.

Which of these is not Python's goals?

a)

Easy and intuitive language

b)

Open source

c)

Understandable

d)

Suitable for everyday tasks

e)

Suitable for only specific tasks

7.

What are the key learning advantages of Python?

a)

Python is interpreted

b)

Python is interactive

c)

Python is object-oriented

d)

Python is a beginner's language

e)

Python is not for novice

8.

What makes Python special?

a)

It’s easy to learn

b)

It’s easy to teach

c)

It’s easy to understand

d)

It’s easy to obtain, install and deploy

e)

It's easy to obtain errors

9.

What are the 2 direct competitors of Python?

a)

Perl

b)

Ruby

c)

Java

d)

C

10.

Authored by Larry Wall

Is more traditional, more conservative than Python, and resembles some of the good old languages derived from the Classic C programming language.

a)

Perl

b)

Ruby

11.

Authored by Yukihiro Matsumoto

Is more innovative and more full of fresh ideas than Python.

a)

Perl

b)

Ruby

12.

Python itself lies somewhere between these Ruby and Perl.

a)

True

b)

False

13.

The two main kinds of Python:

a)

Python 2

b)

Python 3

c)

Python 4

d)

Python 1

14.

These two versions of python are compatible with each other.

a)

True

b)

False

15.

Python 3 isn't just a better version of Python 2 - it is a completely different language, although it's very similar to its predecessor.

a)

True

b)

False

16.

Python supports supports _________ and ________ programming methods as well as ______.

a)

functional

b)

structured

c)

OOP

d)

procedural

17.

Python can be used as _______ language or can be ________ to Byte-code for building large applications.

a)

Scripting

b)

Compiled

c)

Interpreted

d)

Programming

18.

Python provides very high-level dynamic _______ and supports dynamic __________.

a)

data types

b)

type checking

c)

type casting

d)

data exchange

19.

Python does not support automatic garbage collection.

a)

True

b)

False

20.

Python can be easily integrated with C, C++, _____, ______, ______, and Java.

a)

COM

b)

ActiveX

c)

CORBA

d)

Perl

21.

Are the reserved words in Python, and cannot be used as a variable name, function name, or any other identifier.

a)

Keywords

b)

Identifier

c)

Variables

d)

Literals

22.

Python Keywords are ____________ and used to define the ________ and _________ of the Python language.

a)

case-sensitive

b)

case-insensitive

c)

syntax

d)

structure

23.

Is a name given to entities like class, functions, variables, etc.

It helps to differentiate one entity from another.

a)

Keywords

b)

Identifier

c)

Variables

d)

Literals

24.

An identifier can be of any length.

a)

True

b)

False

25.

Keywords and special symbols can be used as identifiers.

a)

True

b)

False

26.

Instructions that a Python interpreter can execute.

a)

Statements

b)

Comments

c)

Indentation

d)

Keywords

27.

In Python, the end of a statement is marked by a _____________.

a)

newline character

b)

space character

c)

tab character

d)

sameline character

28.

Line continuation character. To extend over multiple lines.

a)

\

b)

/

c)

>

d)

{

29.

Explicit line continuation is implied inside parentheses ( ), brackets [ ], and braces { }.

a)

True

b)

False

30.

To define a block of code in Python.

a)

Statements

b)

Comments

c)

Indentation

d)

Keywords

31.

A code block (body of a function, loop, etc.) starts with indentation and ends with the __________.

a)

first unindented line

b)

last unindented line

c)

first indented line

32.

Four whitespaces are used for indentation and are preferred over tabs.

a)

True

b)

False

33.

They describe what is going on inside a program so that a person looking at the source code does not have a hard time figuring it out.

a)

Statements

b)

Comments

c)

Indentation

d)

Keywords

34.

Single-line comments.

a)

#

b)

‘’’ or “””

c)

//

35.

Multi-line strings/comments.

a)

#

b)

‘’’ or “””

c)

//

36.

(‘’’ or “””) Unless they are not docstrings, they do not generate any extra code.

a)

True

b)

False

37.

Named location used to store data in the memory.

a)

Keywords

b)

Identifier

c)

Variables

d)

Literals

e)

Constant

38.

Is a type of variable whose value cannot be changed.

a)

Keywords

b)

Identifier

c)

Variables

d)

Literals

e)

Constant

39.

Raw data given in a variable or constant.

a)

Keywords

b)

Identifier

c)

Variables

d)

Literals

e)

Constant

40.

Three types of literals:

a)

String literal

b)

Character literal

c)

Boolean literal

d)

Numerical literal

41.

Is a sequence of characters surrounded by quotes.

a)

String literal

b)

Character literal

c)

Boolean literal

42.

is a single character surrounded by single or double-quotes.

a)

String literal

b)

Character literal

c)

Boolean literal

43.

Can have any of the two values: True or False.

a)

String literal

b)

Character literal

c)

Boolean literal

44.

What falls under the Python numbers category?

a)

Integers

b)

Floating-point numbers

c)

Complex numbers

d)

Decimal numbers

45.

Can be used to know which class a variable or a value belongs to.

a)

type()

b)

value()

c)

class()

d)

belongs()

46.

Integers can be of any length, it is only limited by the memory available.

a)

True

b)

False

47.

Floating-point numbers accurate up to 15 decimal places.

a)

True

b)

False

48.

Integer and floating points - are not separated by decimal points.

(Ex: 1 is an integer, 1.0 is a floating number)

a)

True

b)

False

49.

Written in the form, x + yj, where xis the real part and y is the imaginary part.

a)

Integers

b)

Floating-point numbers

c)

Complex numbers

50.

Is an ordered sequence of items. (Separated by [])

Mutable.

a)

Lists

b)

Tuple

c)

Set

d)

Dictionary

51.

The value of elements of a list can be altered.

a)

Mutable

b)

Immutable

52.

Once created cannot be modified.

a)

Mutable

b)

Immutable

53.

There are built-in arrays in Python.

a)

True

b)

False

54.

Used to write protect data and are usually faster than lists as they cannot change dynamically.

Defined within parentheses ().

a)

Lists

b)

Tuple

c)

Set

d)

Dictionary

55.

Is an unordered collection of unique items.

They have unique values. (They eliminate duplicates.)

It can perform operations like union, intersection on two sets.

Separated by a comma inside braces {}

a)

Lists

b)

Tuple

c)

Set

d)

Dictionary

56.

Is an unordered collection of key-value pairs.

Generally used when there is a huge amount of data. (Optimized for retrieving data.)

Defined within braces {} with each item being pair in the form key: value.

a)

Lists

b)

Tuple

c)

Set

d)

Dictionary

57.

Is a sequence of Unicode characters.

It can use single quotes or double quotes to represent strings.

a)

Strings

b)

Variables

c)

Keywords

d)

Literals

58.

To get the length of a string.

a)

len()

b)

length()

c)

size()

59.

Takes the passed arguments, formats them, and places them in the string where the placeholders {} are.

a)

format()

b)

form()

c)

formatter()

60.

To insert character that are illegal in a string, use an escape (\) character.

a)

True

b)

False

61.

________ is the newer (to be precise, the current) version of the language.

It's going through its own evolution path, creating its own standards and habits.

a)

Python 2

b)

Python 3

62.

_______ are case-sensitive and used to define the syntax and structure of the Python language.

a)

Keywords

b)

Identifier

c)

Variables

63.

Incorrect indentation will result in ______________.

a)

lndentationError

b)

IndentError

c)

SyntaxError

64.

In format() method, what is the special character used for formatted content?

a)

{}

b)

()

c)

[]

d)

#