Why it prints elements after leaving a space at the beginning of the new line?Get list from server and print each element surrounded by span tagHow to sort contents in a file in pythonEnthought Canopy does not read data from or write data to csv files for PythonPython carriage returnhow to use while loop without infinite loop(python 2.7)How to create loop to scrape data from a column from a wikipedia table?Combine two differently sized lists into a combined setHow to Print in Python 2.7 without newline without bufferingScraping skips some of the page url and does not write all values in CSVHow do I fix invalid syntax error when importing postgis in Python 2.7?
What makes "quality" analog AV cables better than cheap cables?
Tikz draw contour without some edges, and fill
How can I answer high-school writing prompts without sounding weird and fake?
How do I tell my supervisor that he is choosing poor replacements for me while I am on maternity leave?
Does SQL Server allow (make visible) DDL inside a transaction to the transaction prior to commit?
What kind of SATA connector is this?
Forgoing Enlightenment
Jesus' words on the Jews
Why was Thor doubtful about his worthiness to Mjolnir?
Area under the curve - Integrals (Antiderivatives)
How to cope with regret and shame about not fully utilizing opportunities during PhD?
Wireless headphones interfere with Wi-Fi signal on laptop
Was this character’s old age look CGI or make-up?
How can a layman easily get the consensus view of what academia *thinks* about a subject?
Is the expression "To think you would stoop so low" often misused?
Find hamming distance between two Strings of equal length in Java
Is it possible to create different colors in rocket exhaust?
Longest Text in Latin
what does a native speaker say when he wanted to leave his work?
Is there anything special about -1 (0xFFFFFFFF) regarding ADC?
Why is a set not a partition of itself?
Is 12 minutes connection in Bristol Temple Meads long enough?
Why does my circuit work on a breadboard, but not on a perfboard? I am new to soldering
Non-deterministic Finite Automata | Sipser Example 1.16
Why it prints elements after leaving a space at the beginning of the new line?
Get list from server and print each element surrounded by span tagHow to sort contents in a file in pythonEnthought Canopy does not read data from or write data to csv files for PythonPython carriage returnhow to use while loop without infinite loop(python 2.7)How to create loop to scrape data from a column from a wikipedia table?Combine two differently sized lists into a combined setHow to Print in Python 2.7 without newline without bufferingScraping skips some of the page url and does not write all values in CSVHow do I fix invalid syntax error when importing postgis in Python 2.7?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I am using python 2.7
this is a very easy code:
from __future__ import print_function
my_list = [1,2,3,4]
for i in my_list:
# print(i)
print(i, end="n ")
# print(i)
when I print this loop by:
print(i, end="n ")
output:
1
2
3
4
how to solve this issue using this mothed not print(i)
becuase I collect data by the robot without for_loop
. So, I use this code for simplicity
when I need to write the data in the file, I am using end="n "
it is leaving a space at the beginning of the new line
please help me or any suggestion
thank you in advance
python-2.7
add a comment |
I am using python 2.7
this is a very easy code:
from __future__ import print_function
my_list = [1,2,3,4]
for i in my_list:
# print(i)
print(i, end="n ")
# print(i)
when I print this loop by:
print(i, end="n ")
output:
1
2
3
4
how to solve this issue using this mothed not print(i)
becuase I collect data by the robot without for_loop
. So, I use this code for simplicity
when I need to write the data in the file, I am using end="n "
it is leaving a space at the beginning of the new line
please help me or any suggestion
thank you in advance
python-2.7
add a comment |
I am using python 2.7
this is a very easy code:
from __future__ import print_function
my_list = [1,2,3,4]
for i in my_list:
# print(i)
print(i, end="n ")
# print(i)
when I print this loop by:
print(i, end="n ")
output:
1
2
3
4
how to solve this issue using this mothed not print(i)
becuase I collect data by the robot without for_loop
. So, I use this code for simplicity
when I need to write the data in the file, I am using end="n "
it is leaving a space at the beginning of the new line
please help me or any suggestion
thank you in advance
python-2.7
I am using python 2.7
this is a very easy code:
from __future__ import print_function
my_list = [1,2,3,4]
for i in my_list:
# print(i)
print(i, end="n ")
# print(i)
when I print this loop by:
print(i, end="n ")
output:
1
2
3
4
how to solve this issue using this mothed not print(i)
becuase I collect data by the robot without for_loop
. So, I use this code for simplicity
when I need to write the data in the file, I am using end="n "
it is leaving a space at the beginning of the new line
please help me or any suggestion
thank you in advance
python-2.7
python-2.7
edited Mar 23 at 13:33
REDHWAN AL-GABRI
asked Mar 23 at 13:18
REDHWAN AL-GABRIREDHWAN AL-GABRI
84
84
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
The extra space is due to the space you passed in end argument in print function.
instead of print(i, end="n ")
useprint(i, end="n")
Remember that whatever you pass inside double quotes will be displayed as it is on the terminal, so remove that extra space in "n ".
thank you so so much, I don't focus about this wrong, it is fine now
– REDHWAN AL-GABRI
Mar 23 at 13:35
you're welcome!
– Shivam Singh
Mar 23 at 13:38
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55314125%2fwhy-it-prints-elements-after-leaving-a-space-at-the-beginning-of-the-new-line%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
The extra space is due to the space you passed in end argument in print function.
instead of print(i, end="n ")
useprint(i, end="n")
Remember that whatever you pass inside double quotes will be displayed as it is on the terminal, so remove that extra space in "n ".
thank you so so much, I don't focus about this wrong, it is fine now
– REDHWAN AL-GABRI
Mar 23 at 13:35
you're welcome!
– Shivam Singh
Mar 23 at 13:38
add a comment |
The extra space is due to the space you passed in end argument in print function.
instead of print(i, end="n ")
useprint(i, end="n")
Remember that whatever you pass inside double quotes will be displayed as it is on the terminal, so remove that extra space in "n ".
thank you so so much, I don't focus about this wrong, it is fine now
– REDHWAN AL-GABRI
Mar 23 at 13:35
you're welcome!
– Shivam Singh
Mar 23 at 13:38
add a comment |
The extra space is due to the space you passed in end argument in print function.
instead of print(i, end="n ")
useprint(i, end="n")
Remember that whatever you pass inside double quotes will be displayed as it is on the terminal, so remove that extra space in "n ".
The extra space is due to the space you passed in end argument in print function.
instead of print(i, end="n ")
useprint(i, end="n")
Remember that whatever you pass inside double quotes will be displayed as it is on the terminal, so remove that extra space in "n ".
answered Mar 23 at 13:28
Shivam SinghShivam Singh
579
579
thank you so so much, I don't focus about this wrong, it is fine now
– REDHWAN AL-GABRI
Mar 23 at 13:35
you're welcome!
– Shivam Singh
Mar 23 at 13:38
add a comment |
thank you so so much, I don't focus about this wrong, it is fine now
– REDHWAN AL-GABRI
Mar 23 at 13:35
you're welcome!
– Shivam Singh
Mar 23 at 13:38
thank you so so much, I don't focus about this wrong, it is fine now
– REDHWAN AL-GABRI
Mar 23 at 13:35
thank you so so much, I don't focus about this wrong, it is fine now
– REDHWAN AL-GABRI
Mar 23 at 13:35
you're welcome!
– Shivam Singh
Mar 23 at 13:38
you're welcome!
– Shivam Singh
Mar 23 at 13:38
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55314125%2fwhy-it-prints-elements-after-leaving-a-space-at-the-beginning-of-the-new-line%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown