WorksheetsWeek 4 - What is Python?
Total questions: 46
Worksheet time: 23mins
Who developed Python Programming Language?
a) Wick van Rossum
b) Rasmus Lerdorf
c) Guido van Rossum
d) Niene Stom
Which of the following is the correct extension of the Python file?
a) .python
b) .pl
c) .py
d) .p
Which of the following character is used to give single-line comments in Python?
/*
b) #
c) !
d) /*
Which of the following functions is a built-in function in python?
a) factorial()
b) print()
c) seed()
d) sqrt()
print(Hello world!)
Which statement prints I am 10 years old?
pint("I am 10 years old.")
print('I am 10 years old.)
print('')I am 10 years old.
print("I am 10 years old.")
Which statement prints 7 (Select 2 answers)
print 7
print("7"
print("7")
print(3 + 4)
What is the Python built-in function used to display numbers and text on the screen?
input
output
command
Which is the Python logo?
What function is used to output a message in python?
print("")
input=name
name=input
x = 5
y = 6
print(x*y)
The code above displays the following:
11
x*y
Syntax Error
30
What is a output?
A piece of data that is shown on the screen.
Data that the user enters
An output
A orange
What will the output be from the following Python code?
Print("Hello world!")
NameError
Hello world!
"Hello world"
Print(Hello world!)
A function is a mini program that runs and returns a value to your program.
True
False
You need to use a (a) symbol in a string.
To create a comment in Python you use?
@
#
%
$
Integers are...
Decimals
Whole Numbers
Floats
Extra Decimals
Floats are...
Decimals
Whole Numbers
Integers
Extra Decimals
To perform addition in Python we use the
+
-
/
*
To perform division in Python we use the
+
-
/
*
To perform multiplication in Python we use the
+
-
/
*
To perform subtraction in Python we use the
+
-
/
*
To use exponents in Python we use the
+
-
**
*
Errors in the rules of the language are known as?
Syntax
Run TIme
Logic
The hardest type of error to detect is a?
Syntax
Run TIme
Logic Error
An error that cause a program to crash is a..
Syntax
Run Time
Logic Error
The escape sequence for a double quote is?
\"
/"
\\"
//"
The escape sequence for a single quote is?
\'
/'
\\'
//'
The escape sequence for a backslash character is?
\
/
\\
//
This is a placeholder for a value.
String
Variable
Integer
Method
.upper(), .lower(), .title() are all types of
Variables
Integers
Floats
Methods
.upper( ) makes all your text?
Snake Case
Lower Case
Capitalized
Initial Caps
.lower( ) makes all your text?
Snake Case
Lower Case
Capitalized
Initial Caps
.title( ) makes all your text?
Snake Case
Lower Case
Capitalized
Initial Caps
Strings can be added together using what process?
Float
Concatenation
Integers
Variable
The print( ) function can be used with a combination of text and variables?
True
False
The f, in f-strings, stands for?
Fun
Format
Function
Form
f-strings allow you to do...
Place strings into a variable and format it as a variable.
Nothing
Place variables into a string and format it as text.
Place strings into a variable and format it as text.
A series of characters (letters, numbers, and spaces). Always enclosed in quotes.
print( )
String
Variable
Runtime Error
Which of the following is correct?
Print(4-4)
print("4-4")
print(4-4)
Print("4-4")
When you use a variable before it is declared you will get a?
TypeError
SyntaxError
NameError
Syntax Error
Characters that allows Python to use reserved symbol in strings
NameError
SyntaxError
TypeError
Escape Characters
