Font size
WorksheetsPROG3 - Chapter 1
Total questions: 64
Worksheet time: 36mins
Python Is a high-level, interpreted, _______, and object-oriented ________.
interactive
scripting language
programming language
The uses of Python are:
Web development
Data science
Creating software prototypes
Creating web prototypes
Python is designed to be highly readable.
True
False
Python uses __________ keywords frequently whereas other languages use _________.
It also has fewer syntactical constructions than other languages.
English
Tagalog
Chinese
punctuation
commas
Creator of Python.
Born in 1956 in Haarlem, the Netherlands.
Guido van Rossum
Gudo van Roshum
Gido van Rosum
Which of these is not Python's goals?
Easy and intuitive language
Open source
Understandable
Suitable for everyday tasks
Suitable for only specific tasks
What are the key learning advantages of Python?
Python is interpreted
Python is interactive
Python is object-oriented
Python is a beginner's language
Python is not for novice
What makes Python special?
It’s easy to learn
It’s easy to teach
It’s easy to understand
It’s easy to obtain, install and deploy
It's easy to obtain errors
What are the 2 direct competitors of Python?
Perl
Ruby
Java
C
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.
Perl
Ruby
Authored by Yukihiro Matsumoto
Is more innovative and more full of fresh ideas than Python.
Perl
Ruby
Python itself lies somewhere between these Ruby and Perl.
True
False
The two main kinds of Python:
Python 2
Python 3
Python 4
Python 1
These two versions of python are compatible with each other.
True
False
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.
True
False
Python supports supports _________ and ________ programming methods as well as ______.
functional
structured
OOP
procedural
Python can be used as _______ language or can be ________ to Byte-code for building large applications.
Scripting
Compiled
Interpreted
Programming
Python provides very high-level dynamic _______ and supports dynamic __________.
data types
type checking
type casting
data exchange
Python does not support automatic garbage collection.
True
False
Python can be easily integrated with C, C++, _____, ______, ______, and Java.
COM
ActiveX
CORBA
Perl
Are the reserved words in Python, and cannot be used as a variable name, function name, or any other identifier.
Keywords
Identifier
Variables
Literals
Python Keywords are ____________ and used to define the ________ and _________ of the Python language.
case-sensitive
case-insensitive
syntax
structure
Is a name given to entities like class, functions, variables, etc.
It helps to differentiate one entity from another.
Keywords
Identifier
Variables
Literals
An identifier can be of any length.
True
False
Keywords and special symbols can be used as identifiers.
True
False
Instructions that a Python interpreter can execute.
Statements
Comments
Indentation
Keywords
In Python, the end of a statement is marked by a _____________.
newline character
space character
tab character
sameline character
Line continuation character. To extend over multiple lines.
\
/
>
{
Explicit line continuation is implied inside parentheses ( ), brackets [ ], and braces { }.
True
False
To define a block of code in Python.
Statements
Comments
Indentation
Keywords
A code block (body of a function, loop, etc.) starts with indentation and ends with the __________.
first unindented line
last unindented line
first indented line
Four whitespaces are used for indentation and are preferred over tabs.
True
False
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.
Statements
Comments
Indentation
Keywords
Single-line comments.
#
‘’’ or “””
//
Multi-line strings/comments.
#
‘’’ or “””
//
(‘’’ or “””) Unless they are not docstrings, they do not generate any extra code.
True
False
Named location used to store data in the memory.
Keywords
Identifier
Variables
Literals
Constant
Is a type of variable whose value cannot be changed.
Keywords
Identifier
Variables
Literals
Constant
Raw data given in a variable or constant.
Keywords
Identifier
Variables
Literals
Constant
Three types of literals:
String literal
Character literal
Boolean literal
Numerical literal
Is a sequence of characters surrounded by quotes.
String literal
Character literal
Boolean literal
is a single character surrounded by single or double-quotes.
String literal
Character literal
Boolean literal
Can have any of the two values: True or False.
String literal
Character literal
Boolean literal
What falls under the Python numbers category?
Integers
Floating-point numbers
Complex numbers
Decimal numbers
Can be used to know which class a variable or a value belongs to.
type()
value()
class()
belongs()
Integers can be of any length, it is only limited by the memory available.
True
False
Floating-point numbers accurate up to 15 decimal places.
True
False
Integer and floating points - are not separated by decimal points.
(Ex: 1 is an integer, 1.0 is a floating number)
True
False
Written in the form, x + yj, where xis the real part and y is the imaginary part.
Integers
Floating-point numbers
Complex numbers
Is an ordered sequence of items. (Separated by [])
Mutable.
Lists
Tuple
Set
Dictionary
The value of elements of a list can be altered.
Mutable
Immutable
Once created cannot be modified.
Mutable
Immutable
There are built-in arrays in Python.
True
False
Used to write protect data and are usually faster than lists as they cannot change dynamically.
Defined within parentheses ().
Lists
Tuple
Set
Dictionary
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 {}
Lists
Tuple
Set
Dictionary
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.
Lists
Tuple
Set
Dictionary
Is a sequence of Unicode characters.
It can use single quotes or double quotes to represent strings.
Strings
Variables
Keywords
Literals
To get the length of a string.
len()
length()
size()
Takes the passed arguments, formats them, and places them in the string where the placeholders {} are.
format()
form()
formatter()
To insert character that are illegal in a string, use an escape (\) character.
True
False
________ 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.
Python 2
Python 3
_______ are case-sensitive and used to define the syntax and structure of the Python language.
Keywords
Identifier
Variables
Incorrect indentation will result in ______________.
lndentationError
IndentError
SyntaxError
In format() method, what is the special character used for formatted content?
{}
()
[]
#
