- 2
Guyz the code isn't running kindly help🥺
phonebook = {'Smith, Jane' : '123-45-67' , 'Doe, John' : '987-65-43', 'Baker, David' : '567-89-01'} def rev(phonebook): print(phonebook) rev={} for key in phonebook: rev=[phonebook[key]]=key print('phonebook',rev) return rev
7 Respostas
+ 2
Really thankssss alot❤️❤️
+ 1
It runs just fine.
I suspect that the return statement in rev() should be indented one less level so that it allows the loop to complete before it returns. Maybe the print statement should be moved outside the loop, too.
The question I have for you is, where is the rest of the code? You define the rev() function but never call it. There is no output because there is no print statement getting executed.
+ 1
For key,item in phonebook.items():
rev[item]=key
#dedent
return rev
+ 1
+ 1
boualam bourahla why do you post a copy of my code ?
0
I just want my phonebook to be reversed,can u do that.
0
Nope bro ain't running.