Python - selecting 4 random numbers

preview_player
Показать описание
In this video, I create a program to select 4 random problems from my midterm for a "do now" in the days leading up to the midterm.

In this Python program, I use functions, while loops, and if statements.
Рекомендации по теме
Комментарии
Автор

All you have to do to fix your bug is to add an additional check in your while-statement: [...] or problem_number in problems_list: [...], this way you exclude existing elements.
However, since you do not care about the order you could change the type from a list to a set and you won't have the problem with duplicates in the first place.

Hope my explaination was understandable.

DayfRedemption