Font size
WorksheetsPython Basic
Total questions: 38
Worksheet time: 20mins
Which one is correct print command?
print("Hello world!")
print"Hello world!"
print(Hello world!)
print Hello world!
Which one is correct input command?
name=input(Enter your name)
name=input("Enter your name")
name=input"Enter your name"
name=("Enter your name")
What is the function of the "int" command in python?
Print commands
Input data from the user
Enter data to the output
Converts input to an integer
We use _________to store values that can be used to control commands in our code. We can also alter these values throughout the code.
Value
Constant
Iteration
Variable
We can use _________ from the user to control our code.
variable
input
output
We can tell the computer how to make decisions using _________________. Make sure that all the code inside your if/else statement is indented one level!
Loop
if/else statements
print()
variable
What is the function of the tag below?
store meta information about the title
show the server how to index the website
show the title of the website for the browser and search engine result
show the server how to title the website
What is an HTML element?
What is an HTML element?What is an HTML element?What is an HTML element?What is an HTML element?What is an HTML element?
start tag and an end tag, with content in between
everything which is visible when viewing the site
everything inside the head tag
2) What symbol do you use to make a comment in Python?
¬
@
#
\
What data type is 1 letter e.g. f
String
Char
Float
Integer
What is syntax in python?
Syntax is the word used to describe a computer error
It is used to output information
It is used to read information
Syntax is the rules of the programming language
7) To make a value stored in python as an Integer. Which function is used?
word integer
number
num
int
The symbol that must be at the end of the line for if, while, for is:
,
;
.
:
What is the data type for a whole number?
String
Boolean
Float
Integer
What does INT do?
Converts the specified value into an integer number
Inputs number
prints the output
Ask user to input a value
What does the print function do in python?
It can input data.
It's a variable.
It displays something like a string or integer
It loops the code.
How do you display text?
input
output
variable
What will the output?
nothing
display I do not know you
display Hello Rashed
Syntax error
What does an IF statement do?
Closes the program
Asks a question
Makes a decision
Starts the program
The correct way to write a variable in Python?
my_variable = 10
my_variable: 10
my_variable is 10
my variable = 10
Which function converts data to an integer
input()
print()
def
int()
How do you create a variable with the numeric value 5?
x=5
Both the other answers are correct
x = int(5)
x 5
In Python, 'Hello', is the same as "Hello"
True
False
How do you start writing an if statement in Python?
if x > y:
if (x > y)
if x > y then:
if x < y):
What would be the output?
x
6
error
User to enter a number
What is the output of the code below?
Syntax error
print line 3 and line 4 need to be indented
else should not be indented
Ask the user to enter their age
There are ____ types of tag.
3
2
1
4
What will be the output for the following program?
<Hello SJPS>
Hello SJPS
both are correct
Error
Which is the correct tag to insert an image?
<img src="img_football.jpg" alt="Manchester United" width="500" height="600">
<img src="img_football.jpg" alt="Manchester United" width="500" height="600>
img src="img_football.jpg" alt="Manchester United" width="500" height="600">
<img src"img_football.jpg" alt="Manchester United" width="500" height="600">
HTML is a ........................language.
programming
object oriented
markup
scripting
What should a HTML web page start with?
<b>
<html>
<li>
<start>
What are the 3 main parts of an HTML document ?
head, paragraph tag, and html
head, body and html
head, body and text header
html, body and tags
Above is a visualization of an HTML page structure :Which of the following section is displayed in a browser?
<body> section
<head> section
none of the above
<title> section
These are label pieces of content such as "heading", "paragraph", "table", and so on
HTML (Hyper Text Markup Language)
HTML elements
Web Browsers
HTML tags
Container tags are also known as ______
Paired tag
non-paired tag
Empty tag
both a and c
Syntax error
print line 3 and line 4 need to be indented
else should not be indented
Ask the user to enter their age
90
6
invalid code
90,6
6,90
What does this code output?
The answer to 10+10 is 20
The answer to 10+10 is,20
Nothing, the code is invalid.
The answer to 10+10 is20
