官术网_书友最值得收藏!

The print() function

In our first helloworld example, we discussed printing something on the screen. We used the print() function to obtain our result. In Python, a function is a code block that executes a set of defined tasks. The print() function is a part of Python's standard library that prints any combination of alphanumeric characters that is passed as an argument between the quotes. The print() function is used to print information to the screen. It is especially helpful while trying to debug the code. In this example, the print() function was used to print a message on the screen.

In this chapter, the function print() executed the string I am excited to learn Python programming with the Raspberry Pi Zero (we will discuss strings in the later section of this book). It is also possible to write custom function to execute a repetitive task required by the user.

Similarly, the exit() function executes the predefined task of exiting the Python interpreter at the user's call.

主站蜘蛛池模板: 韶山市| 博白县| 邳州市| 张家港市| 宣城市| 大城县| 绩溪县| 石台县| 开封市| 扶绥县| 宝清县| 嘉善县| 桃源县| 龙江县| 宣恩县| 锡林郭勒盟| 南宫市| 晋宁县| 丰县| 东海县| 沙洋县| 涡阳县| 金阳县| 昆山市| 日照市| 雅安市| 昂仁县| 衢州市| 肥东县| 伊宁市| 同心县| 宜兴市| 乌兰浩特市| 通州区| 盱眙县| 舒兰市| 鸡泽县| 吉首市| 滦平县| 临朐县| 合水县|