Creating random values using Python’s random module.Creating variables, using descriptive names.Iteration is a kind of repetition which often involves loops such as for loops and while loops.Īs well as these 3 basic control structures, This simple program covers some other important fundamental programming skills. One of the most powerful aspects of computers is their ability to perform repetition. This involves choosing (selecting) different paths through a program based on conditions specified by the programmer. This involves thinking about the order in which instructions need to be executed to produce the desired result. It makes use of the three basic control structures of sequence, selection and iteration. The program simulates two players taking it in turns to roll a 6-sided dice, and keeps track of the scores. Here’s a simple program in Python that demonstrates some important fundamental concepts in computer programming.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |