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

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.

主站蜘蛛池模板: 承德市| 东丽区| 蒙自县| 辰溪县| 北碚区| 曲松县| 遵化市| 长宁区| 泸州市| 收藏| 华亭县| 嘉祥县| 峡江县| 富宁县| 阿克陶县| 永康市| 荔浦县| 武邑县| 渑池县| 江川县| 广宗县| 安图县| 满洲里市| 安福县| 临泽县| 六盘水市| 长沙县| 五莲县| 尚志市| 曲靖市| 锦州市| 萝北县| 关岭| 嘉禾县| 繁昌县| 连云港市| 泾川县| 荃湾区| 桐乡市| 太康县| 玉门市|