Learn, Share, Build

269
October 02, 2017, at 05:16 AM

I'm learning the basics of python and i want to know in this function, how to insert a new line? I know i could have in the function;

print(f)
 print(f)

But for the sake of this example below, where when calling the function if i wanted to specify how many times to output it. How would i go about making it so there is a new line between each?

I'm suppose to have tried other methods, but as a new learner thats putting the egg before the chicken.

enter code here
def do_twice(f):
    print(f)
do_twice("Hello"*2)
Answer 1

'\n' is the newline character. (see here for more)

So for your example:

def do_twice(f):
    print(f)
do_twice("Hello \n"*2)

Will print

Hello

Hello

Rent Charter Buses Company
READ ALSO
Learn, Share, Build

Learn, Share, Build

I have an Excel (xlsx) file with 40 or so sheets

269
Learn, Share, Build

Learn, Share, Build

I trying to display the items within a listThis is my code:

202
Learn, Share, Build

Learn, Share, Build

I've been trying to find a way to run and update multiple progress-bars at the same time, but so far I'm out of luckI guess I also need a que/run/reset system for this to work

278
Learn, Share, Build

Learn, Share, Build

I have the following list of urls that i am tring to scrape:

269