NEW
Font size
WorksheetsProgramming - Python (year 12)
Total questions: 21
Worksheet time: 10mins
What is a program?
A series of a step-by-step instructions that tell a computer how to solve a task
A video that is watched on a computer
A flowchart written on a computer
The make and model of a computer
How do we get user input from the keyboard?
input = (What is your name?)
input = What is your name?
output = ("What is your name?")
input("What is your name? ")
Which data type is the most suited to store a telephone number in a variable?
string
integer
float
boolean
Which data type would you use for the quantity of stock in a shop?
integer
float
string
boolean
If you want to change the data type to an integer which line of code would you use?
int ("How much pocket money do you have?")
input("How much pocket money do you have?")
int(input("How much pocket money do you have?"))
int = ("How much pocket money do you have?")
print("3+4")
print("Hello" + str(2) + "world!")
Will return True if a string only contains numbers
isalpha()
isnumeric()
int()
string()
Will return True if all characters are alphabetic
isalpha()
isalnum()
isdigit()
lstrip()
What does the % do in python?
Returns the remainder
Integer division
Returns the percentage
Real division
What command is used to access a library of functions?
import
load
get
library
What are the 3 programming constructs?
input ,process, output
sequence, selection, iteration
variable, constant, value
code, test, review
What are the 3 types of programming errors?
syntax, runtime, logic
syntax, overflow, type
runtime, overflow, class
type, boundary, underflow
