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

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.

主站蜘蛛池模板: 九龙坡区| 菏泽市| 巴楚县| 台中市| 麟游县| 芜湖县| 伊宁市| 沿河| 金华市| 永胜县| 翁牛特旗| 剑川县| 光泽县| 揭东县| 玉林市| 吴堡县| 新疆| 韩城市| 太保市| 寿阳县| 长泰县| 建德市| 涡阳县| 利津县| 苍山县| 垦利县| 赤城县| 班玛县| 通江县| 阿勒泰市| 会宁县| 定日县| 项城市| 大安市| 比如县| 南阳市| 临湘市| 香河县| 沐川县| 萍乡市| 武定县|