0
Backstory: Usain Bolt, you, and Qazi had a race. Surprisingly, Usain bolt won. You came in 2nd and Qazi came in 3rd :(. Can you
Backstory: Usain Bolt, you, and Qazi had a race. Surprisingly, Usain bolt won. You came in 2nd and Qazi came in 3rd :(. Can you think of a way to write a function that given a person's name, returns his/her place? ALSO Can you think of a way to write a function that given a place, returns his/her name? WRITE 2 FUNCTIONS One that converts choice to number and One that converts number to choice. """
4 Answers
+ 3
you need a bidirectional map
+ 1
Granted the placing is static, I'd take this approach- You could simply great a dictionary, containing the person as the key, and place as a value. Then you can define your two fuctions. They would contain simple print statements. You don't even have to create functions for that.
0
ok how can i create it
0
šššš