Strings
Lists
Files
Syntax
Miscellaneous
100

Is String an object or a primitive type? 

An Object 

100

Can lists be altered?


What is this property called? 

Yes. Mutability

100

What do all python files end in? 

What files have we used so far? 

.py 

.txt

100

Which is correct?

if x = 2: 

OR 

if x == 2:

if x == 2

100

What text editor are you supposed to be using? 

Atom

200

The output of a program containing only: 

print("Hello" + world)

Error, world is undefined

200

Output of a[3]? 

a[100, 30, 20]


Index out of bounds

200

Where are files stored

Secondary memory 

200

What is python's name for a syntax error

Traceback


200

(50-5*6)/4

5

300

What is the output:

word = "myLittlePony"

print(word[1:6])

yLitt

300

What are the other two types of collection types? 

Dictionaries and Tuples

300

How do you access a file of an unknown name in python? 

Using the open()  and input() function 

300

What is wrong? 

if x ==2:

    print ("no") 

else 

    print ("yes")

There is no : after else

300

What are True and False values called? 

Boolean

400

What two number positions is 'H' located:

snow = "Hope it snows"

0 and -13

400

Output of  a[1] * 3?

a = ['green', 'eggs', 'ham']

eggseggseggs

400

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

400

What is the error?

hello = int(input("Please enter a number":))

The : is outside the quotation

400

What defines the scope of a function

Indentation

500

Which of the following is not a method? 

capitalize()

Len()

startswith()

join()

Len()

500

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

500

What command does the print() method have built-in?

\n

500

answer  = 100 / 5


answer is what type of variable. 

A floating-point 

500

What is the output?

print(int("5" + "4"))

54