How do you write these fucking loops?

When my students, having already learned the basics of Python syntax , understand that the problem is not at all not knowing the syntax, my face breaks into a smug, but still kind smile. The thought "well, I told you" no longer arises. Grew up, apparently, uncle.





A bit of lyrics

- , -, , . , , , . .





, . , . . , , , - . - , - . - , - , . .





. , , - :





, :





, , " ➜ ➜ ". , celebrities - .





, , , for, 5 ( ). :





  • [ 0] , , for.





    , , : ( ), ( - ), , , .





    - , ( , , , , numpy.array', . .), - . , . , - !





    , : .





    , , , , .





  • [1] , , , .





    , , , . - "{ }.{ }.".





    . "Tom Cruise" "T.C." ( - ).





? ! , , , .





. :





. .





  • [2] .





    . , . , : , - 11. , 5 + 6, 14 - 3, 121 . ? . ? Python? Python - !





    - :





() , . "" , , - - . 4 -5 - , .





:





! - , . .





  • [3] , .





    , , celebrity. :





, , . , 5 .





, - 4 . - 0,0,2,2, - 2,2,4,4, . . . : , , 2. , . ? , - . , . , - , . , , . - n, n, n+2, n+2. . , - a, b, c, d. , "", .





  • [4] .





    , . "resident" 0,2,4,6. - , " ". - ( range()) 2, 0 , 2 , ( "resident" 8).





    -, : , , .





. - , .





  • stage [5] Completion. We simply attribute the heading of the loop according to all canons to the already understandable universal iteration.





Conclusion

Programming is very similar to the work of the classic tough detective from the Hollywood TV series. You constantly need to grasp the connection between things that at first glance are absolutely scattered. I'm waiting for criticism of my philosophizing from the programming guru below in the comments. Well, if you are just a person who is still far from programming, but wants to learn by communicating in a human way, and not in abstruse scientific terms, then let us know about yourself.








All Articles