-1

I am a amature in Python,using the python33 version.The problem i am facing while i want to get output of a list of dictionary just like that.

dict = {'name':'Tanvir','Position':'Programmer'};
print dict['name'];

if i run the code then there showing a syntax error.same thing is happening for the list also. Please help me to fix the problem.

Thanks in advance.

zogo
  • 475
  • 2
  • 9
  • 22

1 Answers1

2

In Python 3, print is a function, so you need print(dict[name]). You also don't need the semicolons. You also need to read the Python tutorial to learn the basics first.

BrenBarn
  • 228,001
  • 34
  • 392
  • 371