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

Indentation and tabs

Indentation is a must when writing block code in Python. Indentation is useful when you are writing functions, decision-making statements, looping statements, and classes. This makes it easy to read your Python programs.

We use indentation to indicate the block of code in Python programs. To indent a block of code, you can use spaces or tabs. Refer to the following example:

if val1 > val2:
print ("val1 is greater than val2")
print("This part is not indented")

In the preceding example, we indented the print statement because it comes under the if block. The next print statement doesn't come under the if block and that's why we didn't indent it.

主站蜘蛛池模板: 杭州市| 逊克县| 郧西县| 金秀| 抚宁县| 靖边县| 紫阳县| 神农架林区| 布拖县| 罗定市| 岱山县| 临洮县| 禹城市| 乳源| 仁化县| 昌黎县| 吐鲁番市| 满洲里市| 大新县| 苏尼特左旗| 邢台县| 衡阳县| 清徐县| 临泉县| 合江县| 沙湾县| 苗栗县| 富锦市| 江源县| 龙泉市| 长治市| 普陀区| 昌吉市| 上虞市| 牡丹江市| 星座| 苗栗市| 九寨沟县| 福贡县| 揭东县| 清丰县|