Ukuran huruf
Lembar kerjaPython Programming
Total soal: 40
Worksheet time: 14mins
Which has integer data type?
Phone number
Zip code
HN
Number of students in the class
There are 40 students in a classroom. We would like to get all students whose name starts with "A". Which looping is suitable?
For loop
While loop
You are in the car with traffic jammed at a junction. To cross that junction according to the traffic rules, which one is NOT applicable
While loop
Conditional Statement
For loop
What is a folder?
the name given to a set of recorded information
the name given to the place where files that can be bought
the name given to the place where files that can be stolen
the name given to the place where files that can be stored
Which of the following types of computer languages uses binary code to communicate with the computer?
High-level languages
Assembly languages
Machine language
Database languages
What are the names of the two types of mode that are used in Python? Select two.
Interactive mode
Scratch mode
Imperial mode
Script mode
What is the name of this symbol (>>>)?
Chevrons
Hash tags
Colon
Semi Colon
Python is _____ sensitive which means you must use the same indentation every time.
space
colour
code
word
print(3*4+5)
A syntax error means your code has a 'grammar' mistake or you used symbols/operations incorrectly.
True
False
name = 'Dave'
print (name)
name = 'Dave'
greeting = "Good morning" + name
print (greeting)
What does the following code do? myAge = int (myAge)
Converts the var (variable) myAge to a string
Converts the var (variable) myAge to a integer
Converts the var (variable) myAge from a integer to a string
Converts the var (variable) myAge to if statement
print(Hello world!)
guess=input()
guess=input()
guess=input()
guess=input()
Which word completes this sentence: "Iteration makes code more ___________"
Complex
Efficient
Simple
Straightforward
A FOR loop is....
A COUNT controlled loop
A CONDITION controlled loop
A WHILE loop is....
A COUNT controlled loop
A CONDITION controlled loop
What will the output be for the code shown here?
3,2,1,0
0,1,2,3
3,2,1
1,2,3
What would the output be for the code shown here?
0,1,2,3,4,5,6,7,8,9
1,2,3,4,5,6,7,8,9,10
0,2,4,6,8,10
0,2,4,6,8
Anil is writing a "rock, scissors, paper" program. He wants the game to repeat until the user doesn't want to play anymore. What loop should he use?
a FOR loop
a WHILE loop
Clara is writing a program that will print out the first ten numbers of a times table (chosen by the user). Should she use....
a FOR loop
a WHILE loop
Tara has written a "Hide and Seek Simulator" - what will happen when she runs it?
It will print "1,2,3,4,5,6,7,8,9,10 Coming ready or not!"
The program will not run
It will print "1,2,3,4,5,6,7,8,9,11 Coming ready or not!"
It will print ("10 Coming ready or not!")
