Commands
Basic Knowledge
Solving Tasks
Functions and Parameters
Lists and Dictionaries
100

Which command will display the text 'Hello world!' on the screen? 

A) print(Hello world!) 

B) print("Hello world!")

C) print "Hello world!" 

D) print = "Hello world!" 

The Correct Answer is : 

B) print("Hello world!")

100

What is a variable? 

A) A piece of data that can change

B) A coding technique 

C) A piece of data you cannot change 

D) A special file 

The correct answer is:

A) A piece of data that can change

100

Which command will correctly ask the user for their age? 

A) age = input(How old are you?) 

B) input("How old are you?") = age 

C) How old are you = input() 

D) age = input("How old are you?")

The correct answer is:

D) age = input("How old are you?")

100

What is the keyword used to start defining a function?

The correct answer is def

100

Is the following code a list or dictionary?


names = ["Renee", "Rainetta", "Travis", "Jess"]

It is a list

200

myName = input() - Is myName a string, a function, a variable, or a method 

A) String

B) Variable

C) Function

D) Method

The correct answer is:

B) Variable

200

What does input do? 

A) It allows users to change the program 

B) It allows a user to solve a task 

C) It converts data types 

D) It allows users to enter data

The correct answer is :

D) It allows users to enter data

200

What is the result of this command? print ("5" + "3") 

A) 8 

B) "8" 

C) "5" + "3" 

D) 53

The correct answer is :

D) 53

200

Which of these is the correct way to call a function named work?

a. work():

b. work()

c. work

d. def work():

The correct answer is 

b. work()

200

Is the following code a list or dictionary?


scores = {

    "Jess" : 100,

    "Kaylee" : 72,

    "Keagan" : 91

}

This is a dictionary

300

Which function will convert a number to a string? 

A) int() 

B) chr() 

C) str()

D) ord() 

The correct answer is :

C) str()

300

what data type is 3.95? 

A) Integer

B) Float

C) String 

D) Character 

The correct answer is:

B) Float

300

Which decision statement will be triggered if the variable x is less than 20? 

A) if x > 20: 

B) if x == 20: 

C) if x <> 20: 

D) if x < 20:

The correct answer is:

D) if x < 20:

300

Parameters are also known as...

placeholders

400

Which function will convert a string containing only digits into a number? 

A) int()

B) ord() 

C) chr() 

D) str() 

The correct answer is:

A) int()

400

What would the output of this code be if the user entered the value 70? 

if grade >= 80:

    print("Distinction")

elif grade >=70:

    print("Merit")

elif grade >= 60:

    print("Pass")

The correct answer is:

Merit

400

How would we fix this code? 

name= "Bob"

print(Name)

The correct answer is:

Make 'Name' lower case

400

Arguments are also known as 

actual values

500

What effect does the # character have? 

A) Tells Python that this is a really important line of code. 

B) Tells Python to tweet when this line of code gets run. 

C) Tells Python to ignore the rest of the line.

D) It does nothing, Python ignores this character. 

The correct answer is:

C) Tells Python to ignore the rest of the line.

500

Which of these codes tests whether the variable x is the same as 'Hello'? 

A) x = "Hello" 

B) x == "Hello"

C) x != "Hello" 

D) x <> "Hello"

The correct answer is:

B) x == "Hello"

500

What would the output of this program be? 

number1=3

number2=7

number3=5

print(number1+number2*number3)

The correct answer is:

38

500

What is the argument in the following code?

day = input("What day is it?")

def work(x):

print("There is no work on " + x)

work(day)


The variable day