In this video we look at a Python program that simulates the rolling of two dice until “snake eyes” (both dice 1’s) occurs. We use here a while loop since we do not know the number of times we will be in the loop. That process is repeated over many samples to determine an average of the number of rolls required. The averaging over samples is achieved with a for looop because in that case we do know how many iterations will be involved. The second program adds rolling “box cars” (rolling two 6’s) to the simulation – and discusses how the condition relates to de Morgan’s Theorem.
http://www1.lasalle.edu/~blum/c341wks...
http://www1.lasalle.edu/~blum/c341wks...
На этой странице сайта вы можете посмотреть видео онлайн Python Example Program: Snake Eyes Simulation (Nested Loops: a while inside a for) длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Thomas Blum 11 Сентябрь 2021, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 145 раз и оно понравилось 0 зрителям. Приятного просмотра!