Is String an object or a primitive type?
An Object
Can lists be altered?
What is this property called?
Yes. Mutability
What do all python files end in?
What files have we used so far?
.py
.txt
Which is correct?
if x = 2:
OR
if x == 2:
if x == 2
What text editor are you supposed to be using?
Atom
The output of a program containing only:
print("Hello" + world)
Error, world is undefined
Output of a[3]?
a[100, 30, 20]
Index out of bounds
Where are files stored
Secondary memory
What is python's name for a syntax error
Traceback
(50-5*6)/4
5
What is the output:
word = "myLittlePony"
print(word[1:6])
yLitt
What are the other two types of collection types?
Dictionaries and Tuples
How do you access a file of an unknown name in python?
Using the open() and input() function
What is wrong?
if x ==2:
print ("no")
else
print ("yes")
There is no : after else
What are True and False values called?
Boolean
What two number positions is 'H' located:
snow = "Hope it snows"
0 and -13
Output of a[1] * 3?
a = ['green', 'eggs', 'ham']
eggseggseggs
What is a file-handle?
What loops do we use with files?
A variable from which python can read and write data from the file.
For loops
What is the error?
hello = int(input("Please enter a number":))
The : is outside the quotation
What defines the scope of a function
Indentation
Which of the following is not a method?
capitalize()
Len()
startswith()
join()
Len()
The output of:
nums = [1,19,6,10,-4,12,4,18,20,17,-2]
total = 0
for i in range (len(nums)):
if (i % 2 == 0):
total += nums[i]
print (total)
25
What command does the print() method have built-in?
\n
answer = 100 / 5
answer is what type of variable.
A floating-point
What is the output?
print(int("5" + "4"))
54