WorksheetsPython and Linux Review
Total questions: 20
Worksheet time: 18mins
What does the command mkdir do?
creates a file
creates a directory
creates a virus
None of the above
Which of the following is an example of an int?
17.56
"This is an announcement!"
45
[2, "dogs", "cats", 4.75]
Which Linux keyword do we use to start the Python command prompt?
python
python3
snake314
None of the above
Which of the following is a string?
'45'
"This is the one you've been looking for! Basil! Basil! Just great deals!"
" "
All of the above
True or false: You can have a list inside another list.
TRUE
FALSE
Consider the piece of code in the problem. What is the value of sum if we have python display it?
51
61
None
None of the above
What is wrong with the following code?
no problems
name was not declared
second was not declared
word was not declared
What is a boolean?
a variable that is an integer
a variable that has a decimal point value
a true or false value
A float is the same thing as an int.
TRUE
FALSE
An int is the same thing as a float.
TRUE
FALSE
Consider the code above. If we declare a new variable as other = "Rudolph" and another as whole_lyric to put everything together, what should whole_lyric be?
whole_lyric = other + song + song_two
whole_lyric = song + song_two + other
whole_lyric = song + other + song_two
None of the above
If we have Python display the value of result, what would it be? Hint: You can use the calculator on your computer to check your work.
95
314
276
951
What kind of result would we get if we typed in Python...
"12" in "Twelve Days of Christmas"
TRUE
FALSE
What would the result be if we typed into Python:
"Malrey" in "We are Marley and Marley! Whoa!"
TRUE
FALSE
EXTRA:
Kermit the Frog played Bob Cratchit on Muppet Christmas Carol
YES
NO
If we declared a variable muppet_full_name, which expression would make the most sense in declaring it?
muppet_full_name = None
muppet_full_name = muppet_last_name + muppet
muppet_full_name = muppet + muppet_last_name
muppet_full_name = muppet
What is the function we use in Python to call for the user's input?
raw_input()
say_something()
input()
None of the above
What is the difference between rm and rmdir
No difference
rm removes files and rmdir removes directories
rm removes directories and rmdir removes files
None of the above
What kind of values does a boolean variable have
characters and spaces
True and False
int
None of the above
What does hostname -I do in Linux?
displays the computer's hostname
displays the IP address
reboots the computer
None of the above
