0 votes
1 view
in Python by (44.6k points)

I know that in C++, this \n is used for giving any spaces but I want to know what we can use in Python?

I don't want to have to use: 

print ("   "). 

1 Answer

0 votes
by (96.2k points)

Instead of that, you can use the below code:

x=' ';

The above will print one space:

print(x); 

The below code will print 10 spaces:

print(10*x) 

The below code will print 10 whites spaces between Hello & World on the Python console:

print("Hello"+10*x+"world")

Related questions

0 votes
1 answer
0 votes
1 answer
asked Jul 16, 2019 in Python by leealex956 (6.5k points)
0 votes
1 answer
0 votes
1 answer
asked Sep 3 in Python by ashely (44.6k points)
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...