• Register
1 vote
17 views

I am new to pyhotn programming I was trying to write a program for my practice but I failed to execute an empty line in my output. The code I wrote is :

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

DoTheWork('Kamrul')
DoTheWork('Noman')

And gives me the output :

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

I am getting no errors but I failed to execute an empty line .

Can anyone help me out.

10 7 2
6,050 points

1 Answer

0 votes

To execute a blank line or an empty line in your python you should use :

print("\n")

So your programm should be like:

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

DoTheWork('Kamrul')
DoTheWork('Noman')

and you will get the output:

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

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

It should help you out.

11 6 4
34,930 points

Related questions

0 votes
1 answer 23 views
23 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 Gavin 15.3k points
1 vote
1 answer 32 views
32 views
I am trying to write a script to print specific words after a particular string. Here is the input file Theyare "playing in the ground", with friends Theyare "going to Paris", with family Theyare "motivating to learn new things", by themselves In the output I am trying to select "are" as the keyword ... open ('input.txt', 'r') as f: for lines in f: a = re.search(r'\bare', f): if a: print (lines)
asked Jul 15 anonymous
0 votes
1 answer 9 views
9 views
Problem: Hi, I know I am asking a silly question but how do you print in the next line in python?
asked Oct 8 Ahsan 1.8k points
1 vote
1 answer 24 views
24 views
Probelm: I have 4 values that are: a = 9 b = 13.58 c = "allforallinall" d = [9, 13, 99] For those four values I tried to print which type of a variable they are, So I wrote this python program: a = 9 b = 13.58 c = "allforallinall" d = [9, 13, ... If this is not the way to print the type of a variable which is and how to print the type of a variable using a python program. Thanks in advance.
asked May 17 samhaz 5k points
0 votes
1 answer 5 views
5 views
How to take two input in the same line from user? Like What is your name and age?
asked Oct 10 Ahsan 1.8k points