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

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.

主站蜘蛛池模板: 香港| 古交市| 嘉荫县| 濮阳市| 张家界市| 林口县| 阿拉善左旗| 宝兴县| 花莲县| 阳泉市| 景东| 大埔区| 子长县| 静宁县| 司法| 武功县| 灵山县| 溆浦县| 大余县| 鹰潭市| 浙江省| 长子县| 江川县| 福贡县| 茶陵县| 孙吴县| 灵川县| 长岭县| 兴业县| 株洲市| 两当县| 怀宁县| 凌云县| 申扎县| 黄大仙区| 婺源县| 景泰县| 耒阳市| 博湖县| 西丰县| 洛宁县|