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

Ads









Related Tutorials/Questions & Answers:
how to print dot in python without newline
how to print dot in python without newline  Hi, I a debugging... 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
how to print dot in python without newline
how to print dot in python without newline  Hi, I a debugging... 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
Advertisements
print without newline in python
print without newline in python  Hi, I have a Python program... the print it in one line. My example: print("I ") print("Love ") print("Python") But the output is coming in new lines. I want to know how to print without
print without newline in python
print without newline in python  Hi, I have a Python program... the print it in one line. My example: print("I ") print("Love ") print("Python") But the output is coming in new lines. I want to know how to print without
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
python replace newline with space
python replace newline with space  Hi, I want to replace newline character \n With space in python. How to replace newline with space in python? Thanks   Hi, Its easy in python. You can use the replace method
python replace newline with space
python replace newline with space  Hi, I want to replace newline character \n With space in python. How to replace newline with space in python? Thanks   Hi, Its easy in python. You can use the replace method
How to print like printf in python
How to print like printf in python  Hi, I am from C background and there used to be printf function. Jow to print like printf in python? The printf function is C/C++ is very useful. So, looking for some line printf in Python
how to print float with 2 decimals python
how to print float with 2 decimals python  Hi, I am new to Python programming and trying to print float value on console. I want to print this value with 2 decimals places. How to print float with 2 decimals python
print reverse string without api
print reverse string without api  accept a string and print reverse without using api
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
ModuleNotFoundError: No module named 'python-graph-dot'
named 'python-graph-dot' How to remove the ModuleNotFoundError: No module named 'python-graph-dot' error? Thanks   Hi, In your...ModuleNotFoundError: No module named 'python-graph-dot'  Hi, My
ModuleNotFoundError: No module named 'python-graph-dot'
named 'python-graph-dot' How to remove the ModuleNotFoundError: No module named 'python-graph-dot' error? Thanks   Hi, In your...ModuleNotFoundError: No module named 'python-graph-dot'  Hi, My
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 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
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
ModuleNotFoundError: No module named 'flake8-class-newline'
: No module named 'flake8-class-newline' How to remove the ModuleNotFoundError... flake8-class-newline python with following command: pip install flake8-class-newline After the installation of flake8-class-newline python library
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
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 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
ModuleNotFoundError: No module named 'print-python'
'print-python' How to remove the ModuleNotFoundError: No module named 'print-python' error? Thanks   Hi, In your python...ModuleNotFoundError: No module named 'print-python'  Hi, My Python
python print on same line in loop
this and print in the same line. Let's know how to make function in Python to print data...python print on same line in loop  Hi, I have a unique requirement in Python where I have to print data in the same line. When I am using
python print dots with printf style
python print dots with printf style  Hi, There is printf function in c and c++. How to use same system function python? I want program in python thats print dots with printf style. Thanks
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 to print spark dataframe data
how to print spark dataframe data  Hi, I have a dataframe in spark and i want to print all the data on console. How it can be done. how to print... is in "data" variable and you want to print it. Its simple and one line function to print

Ads