• Register
110 points
7

Tab size in python 

Today we will see in our website kodlogs what is the default tab size in Python programming language. According to my preference, there are 4 spaces in pycharm. Python is considered to be 8 default tab size. 

 python indentation Explain.  

We learn a lot when we are programming in Python. When we are practicing, we learn a lot. I estimated the tab size in Python with a small program if else.  If you don't give space in code block 2 by giving condition, then error appears. If you give space, error is gone. Let's share the program with you. And try to understand more default tab size.

Expandtabs

Remember, the program uses expandtabs to control the space. If a value is given with this command, then that much space will appear. Let's see an example. Space will also come from the tab Tab / t.  ۔

Example 1

>>>T="Kodlogs "
>>>print(x)
Kodlogs 
>>>T="K\t odlogs "
>>>print(x)
K    odlogs
>>>T="K\t odlogs "
>>>print(x.expandtabs(15))
K                                  odlogs

Example 2

Tab size explain 

Print ("My self is Tania ")
age=int(input())
If age > 20:
....Print("Wellcome jimcoder ")
else
....Print("Wellcome to kodlogs website ")

I hope you are understand default tab size in python. 

110 points
7