0430 "Learning Programming with Children" reading notes 2

Source: Internet
Author: User

1.python Encoding Convention (Convention), which always indents a block of code by 4 spaces.

2. Today expanded a small job code, the original job is only in the interactive programming to guess the password, the job added by their own functions are: with the GUI window implementation + Loop + Countdown reminder (this can actually add sound, remember here, remember to try). Write the time also encountered a lot of problems, this problem by the roommate B assists solve (roommate a where, well, TA is behind me with a group of students playing cards), the problem is:

----How do I enter characters in a window? Chashe learned that Easygui inside has enterbox function support this function;

How do----determine the number of loops? Run directly, do not think in the end should add 1 or minus 1 of the problem;

----How do I jump out of the loop to implement the countdown reminder? If nested if inside if, but need to pay attention to the space;

----How do I get the program to exit after executing a block of code? Use the break statement mentioned above.

3. The code is as follows (need to be optimized, present level lacks, consider later):

0430 "Learning Programming with Children" reading notes 2

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.