+ 12
What My Error
name = {'Name': 'Pedro', 'Age': ' 30'} name['Name'] name['Age']
11 odpowiedzi
+ 40
No error, but if you want to print the values in the dictionary to the console, you have to use print():
print( name['Name'] )
print( name['Age'] )
+ 14
You don't have to use single quote in object variables name like 'Name' and 'Age' this is wrong.
+ 5
Joakim Nyland Thanks! :D
+ 3
David I was wrong to just show the dictionary '-'
+ 2
Just print them... ;)
+ 2
No error yet, but you have to complete the code to make it useful. name['Name'] and co is just like calling you on the phone 🤳 and not saying why I called...
+ 1
The statement
name['Name'] and name['Age'] is just returning their corresponding value.
To use them you need to either print them using print() func. or do some other operation.
Hope it help...
+ 1
As pointed out by others just use print() to print out the values.
0
You can also used a loop to print adjacent 🔑 and his value
0
Just add print() method as-
Print(name['Name'])
print(name['Age'])
- 15
It all wrong