Specs: Python3.3.2
What I intend to do:
Take a dictionary as input and return one as output, but the values are now the keys and vice versa
Question: I believe that I can figure out the key-and-value-switch part. But I don't know how to take a dictionary as input.(and keep the object type as dict
)
What I tried:
a = input("Please enter a dictionary: ")
print(a)
Result: {'a':1,'b':2}
. BUT:
This turned out to be a string object, as is shown using type(a)
and getting <class 'str'>
as result.