Day 04 Challenge 2 is now completed. It’s about selecting from a list of names who will be paying the bill using the Python Randomisation function.
The lesson is just 13 mins. After that, we have to complete the exercise/challenge on our own based on what we’ve understood from Day 01.
It took me half an hour to write the code, to be honest, but it’s so satisfying when you finally worked it out on your own.
Here is my code against our instructor’s code:
And here it is in action:
You know what, there is a much shorter solution here and that is by using the function called choice(), but for this exercise, we were told not to use this function and find a way to write a code that will work and give the same output.
So the code will end up like this:
I’m looking forward to the next challenge; Day 04 Challenge 03.