Particularly if you did not guess right, it is important to X = 3 # simple sequential code y = x + 2 # updating two variables y = 2 * y x = y - x print ( x, y )Ĭan you predict the result? Run the program and check. Situation, where statements are just executed in textual order. To prepare for that weįirst follow how variables can be updated in an even simpler This will be particularly important in loops. The value of already defined variables can be.There are two Python statement types to do that: the simplerįor loops, which we take up shortly, and while loops, which Repetition, looping back over the same block of code again andĪgain. To keep a computer doing useful work we need Practically, we cannot write millions of instructions to keep Get a program that would run by itself for more than a fraction of With the techniques discussed so far, it would be hard to Modern computers can do millions or even billions of instructions a
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |