错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Conditional Statements & Event Handling: How Do I Control the Program Flow and Make the Program React to User Actions and Other Events?

  • Joachim L. Zuckarelli

摘要

This chapter is about how to branch within a program depending on the situation, for example, when processing user input. We will therefore look at Python’s version of the classic If-Else statement, which is used to execute alternative parts of the code depending on certain conditions, and how to make your program flow respond to events, such as user clicks on a graphical user interface.