• Register
1 vote
24 views

Problem:

I am beginner in python programming language and I am following an online course  and doing my coding practice. 
I have a question how can I give space between two lines in python or how can I print a blank line in python?

 

10 7 2
6,060 points

Please log in or register to answer this question.

1 Answer

1 vote

Answer:

To execute a blank line or to give space between two line or print an empty line in your python program you should use :

print("\n")

For example I wrote this code :

def Work(worker):
    print("Its an oder to you")
    print("Please do the work" + " " + worker  )
    print("In one day\n")
    

Work('Piers')
Work('Illiana')

and you will get the output:

Its an oder to you
Please do the work Piers
In one day

Its an oder to you
Please do the work Illiana
In one day
11 6 4
34,950 points

Related questions

0 votes
1 answer 8 views
8 views
Problem: I want to add spacing between the images. It could be vertical or horizontal. I just need to learn it for the basics. Please clarifiy it with examples.
asked Oct 13, 2020 Ahsan 1.8k points
0 votes
1 answer 15 views
15 views asked Oct 24, 2020 Shaad Sh 800 points
0 votes
1 answer 11 views
11 views
Problem: I need to get a line count of a large file (hundreds of thousands of lines) in python. What is the most efficient way both memory- and time-wise? At the moment I do: def file_len(fname): with open(fname) as f: for i, l in enumerate(f): pass return i + 1 is it possible to do any better?
asked Feb 20 Mashhoodch 9.9k points
0 votes
1 answer 18 views
18 views
Problem: for reasonably sized files, is to read the file as a list of lines so that the count of lines is the length of the list. If the file’s path is in a string bound to the thefilepath variable, that’s just: count = len(open(thefilepath).readlines ... humongous files, a loop using the xreadlines method always works: count = 0 for line in open(thefilepath).xreadlines( ): count += 1
asked Jan 23 Mashhoodch 9.9k points
1 vote
1 answer 25 views
25 views
Problem: I have a python file that contains too many lines of code. I have written a code to count the total number of lines in a exact file. My code: def file_name(fname): with open(fname) as fn: for i, l in enumerate(fn): pass return i+1 Does the code give me the exact count ? If not how can I solve this?
asked Apr 5, 2020 LizzyM 6.1k points
1 vote
1 answer 17 views
17 views
Problem: Well, I have a text file containing thousands of lines possibly. I am willing to give them a count (if possible). What is the easiest and efficient way to write a program to get number of lines in a file python? Please, keep it simple so that I can understand the code easily. Thanks.
asked Mar 29, 2020 Gavin 15.3k points
0 votes
1 answer 29 views
29 views
I have a python file that contains too many lines of code. I have written a code to count the total number of lines in a exact file (Don’t have any idea if it works). My code: def file_name(fname): with open(fname) as fn: for i, l in enumerate(fn): pass return i+1 Does the code give me the exact count ?
asked Mar 10, 2020 LizzyM 6.1k points
0 votes
1 answer 84 views
84 views
I am new in Python and i am finding an answers at kodlogs where i have to read a line of space separated integers. I am using Python-2.
asked Sep 25, 2020 Daniel Anderson 4k points
0 votes
1 answer 29 views
29 views
Problem: In C++, \n is used in various conditions, but what do I use in Python I am a bit confused? I don't want to have to use: print (" "). This doesn't seem a very good way to implement. Any help will be great!
asked Jun 3, 2020 Gavin 15.3k points
0 votes
1 answer 4 views
4 views
Problem: Is this possible through css?I tried: tr.classname {border-spacing:5em} in vain. Maybe I am doing something wrong?
asked 4 days ago sasha 13.2k points