how to print dot in python without newline

Ads
 

how to print dot in python without newline

Hi,

I a debugging python program and I am using following code to print dots:

print("................")

I want to print pre-defined number of dots for testing purpose.

For example in some loop I want to print 10 dots and in other places i want to print 20 dots without new line.

Is there any easy solution?

how to print dot in python without newline?

Can I use variable to decide no of times dot to be printed?

I am searching for easy solution.

Thanks

View Answers

February 15, 2019 at 9:08 PM

HI,

You can use following code:

print("."*10);

This code will print 10 dots without new line.

Here is output of the program.

>>> print("."*10);
..........

You can also define a variable to print the no of times and then use it with the print command as shown below:

no_of_times = 20;
print ("." * no_of_times);

Here is output:

>>> no_of_times = 20;
>>> print ("." * no_of_times);
....................
>>>

This way you can print dots pre-defined no of times.

Thanks


February 15, 2019 at 10:22 PM

Hi,

Here is output of the example program:

Thanks


February 15, 2019 at 10:23 PM

Hi,

Check more tutorials at:

Python Tutorials

Thanks

Ads









Related Tutorials/Questions & Answers:
print the newline
print the newline  Why doesn?t the following code print the newline properly? <?php $str = ?Hello, there.\nHow are you?\nThanks for visiting.?; print $str; ?>   Hi friends, Inside the single quotes \n (newline
How to print a webpage without url and date in jsp ?
How to print a webpage without url and date in jsp ?  How to print a webpage without url and date in jsp
Advertisements
how can i remove newline characters and tabs
how can i remove newline characters and tabs   how can i remove newline characters and tabs ? but i wont to using GUI .please help
how to move pointer in Textfield to newline
how to move pointer in Textfield to newline  consider my case and provide me solutions: import java.awt.; import java.awt.event.; class Table1 extends Frame implements ActionListener{ TextField tf1,tf2,tf3
print reverse string without api
print reverse string without api  accept a string and print reverse without using api
How to run external command in Python?
How to run external command in Python?  Hi, I am writing an application in Python and there is requirement of calling the external command from... external command. How to run external command in Python? Thanks   Hi
how to print the server time
how to print the server time  i want to print database time in clintside and update time in every secound without creating connection to database for each time. how can i do
how to print - Java Beginners
how to print  how to print something on console without using System.out.print() method ?  Hi Friend, You can use PrintWriter to write anything on the console. import java.io.*; public class Print{ public static
dot net
dot net  how to open a new window having detailed contents by clicking a marquee text in a page(like news details opening on clicking flash news title) in dot net 2003
Java write newline
Java write newline       Following example demonstrates,  how to get newline feature... of abstract writer class. In the example newLine feature is brought using
how to print the server time
how to print the server time  how to print the server time in jsp and update time in fix interval
How to print this Format exactly?
How to print this Format exactly?   * * * & reverse
How to print this in java?
How to print pattern in Java?  How to print a particular pattern in Java...;  How to print this in java
how to print String as pattern ?
how to print String as pattern ?  i have a one String name ="rajesh" i want to print pattern like r * ra ** raj raje rajes rajesh please help me
How to print UIButton id
How to print UIButton id  How to get the id of the button in the IOS application? Thanks   Hi, You can use the following code: - (IBAction)btnClicked:(id)sender { UIButton *button = (UIButton *)sender; int
how to print the following pattern
how to print the following pattern  Hello hEllo heLlo helLo hellO pls reply soon its an emergency   class StringPattern { public static void main(String[] args) { String st="hello
how to print pdf format
how to print pdf format  Hi every body iam doing school project iam using backend as oracle front end java .how to print student marks list /attendence in pdf format. please help me. thanks in advance.   Here
print selected checkbox names in array without form tag
print selected checkbox names in array without form tag  Hi everyone ... I have problem in my program. I have hashmap i.e. collection , my... seleced checked checkbox names, when i click on button but without using FORM tag
How to design a foot print on the sand, print on the sand, print
How to design a foot print on the sand       You might have seen foot prints on the sand field. Do you think, it can be design in the photoshop, yes I have done here. I have used
how to print JInternal frame component ?
how to print JInternal frame component ?  hello sir, i devalop a swing application .but problem is that how display report & print it. some data prefech from database & keep to jtable but how it is print with table
How can print integer in method
How can print integer in method   a method call process public process(int jobid,int remain){ } how to print int jobid ,int remain in for loop jobid in proc[0],remain in proc[1],both show in text file how to print proc[0
How to print current time in r?
How to print current time in r?  Hi, I am learning and want to print current date and time on console. How to print current time in R Programming? Thanks   Hi, You should use Sys.time() for getting current date
How to print the following pattern in java?
How to print the following pattern in java?  How to print the following pattern in java? he he is he is going he is going in   import java.io.*; class StringPattern { public static void main(String[] args
how to print HTML using javascript or Jquery
how to print HTML using javascript or Jquery  is there any way to print a document(created using Html and javascript) without using window.print... used Iframe for print, but this only work in chrome, but I have required one
struct dot notation
struct dot notation  what is a dot notation in struct
how to print of hours and minutes of 8725 seconds
how to print of hours and minutes of 8725 seconds  how to print of hours and minutes of 8725 seconds
how to print all colors using awt
how to print all colors using awt  how to print all colors using awt
How to pretty print XML from Java?
How to pretty print XML from Java?  How to pretty print XML from Java
how to print headings horizontally in jsp
how to print headings horizontally in jsp  In one of my jsp i have used for loop. in every iteration it will fetch value from db and print it on heading section, it prints vertically but my requirement is to print it horizontally
how to print from right to left in java????
how to print from right to left in java????   can anyone pls tell how to print from right to left in java
How to call print dialog box through JMenuItem?
How to call print dialog box through JMenuItem?  What is the way to call the print dialog box through JMenuItem to print the current page like we can do in javascript by calling window.print() function

Ads