I entirelyfogot the syntax for print


#1



https://www.codecademy.com/courses/python-beginner-en-pwmb1/2/1?curriculum_id=4f89dab3d788890003000096#


how to print two names in a single print statement . i forgot


Replace this line with your code.


#2

there are multiply ways:

print variable1, variable2
print "%s %s" % ( variable1, variable2)

you can also use format, you can read about it here


#3

https://www.codecademy.com/courses/python-beginner-en-pwmb1/2/1?curriculum_id=4f89dab3d788890003000096#

Assigning a dictionary with three key-value pairs to residents:

residents = {'Puffin' : 104, 'Sloth' : 105, 'Burmese Python' : 106}

print residents['Puffin'] # Prints Puffin's room number

print residents[Sloth, Burmese Python]

File "python", line 6
print residents[Sloth, Burmese Python]
^
SyntaxError: invalid syntax


#4

i have to type sloth and burmese python in one statement


#5

you forgot some apostrophes (')

If you have to print multiply dictionary items, you would need to do it right:

print dictionaryName['keyname'], dictionaryName['otherKeyName']

you need to access the dictionary in two different instances.


#6

thank you very much. i initially confused with normal and dictionaries.


#7

what you did:

print residents[Sloth, Burmese Python]

is a invalid shortcut, then you try to access two key values in on go, that doesn't work