Python 1
Data Structures/Problem Solving
python 2
Lists
dictionaries
100

How do we show something on the console

print()

100

How do we print "Delhi" in this structure


country = { "India": ["Delhi", "Maharashtra", "Haryana", "Uttar Pradesh", "Himachal Pradesh"]

country["India"][0]



100

What command do you get user response?

What is input()

100

How do we create a list

with []

100

What do we use to create a dictionary

{}

200

What data type is: "True"

what is string

200

What is missing in this line of code:

print(hello world")

what is opening quotes

200

what are the two types of loops

while and for

200

What index would the first element in a list have

0

200

What is the value in {"bob":500}

500

300

What data type is 9000

What is an Integer

300

What is the result

x=6

y=8

x=4

print(x+y)

what is 12

300

What data type is the number 3?

what is an int

300

x = [3,5,7]

how do we add 3 and 7

x[0]+x[2]

300

How would we change the 9 into 500

{"tom":9}

x["tom"] = 500

400
What is the result of: print("5"+"3")


what is 53

400

How do we print 5?


R = {'X':[1, 2, 3], 'Y':[4, 5, 6]}

R["Y"][1]

400

How do we remove an element from a list

x.remove()

400

Which method adds an element to a list

.append()

400

how do we delete a dictionary

del

500

What is the result of: print(10%5)

what is 0

500

How do print Marie's Age


people = {1: {'name': 'John', 'age': '27', 'gender': 'Male'},          2: {'name': 'Marie', 'age': '22', 'gender': 'Female'}}

people[2]["age"]

500

What function converts a String into an integer

int()

500

How do we print the number 5

[[3,5],6,8,4]

x[0][1]

500

How do you access a value in a dictionary

X[key name]