+ 1
Hello everyone! I have problem on phyton. Problem is in the end of output there is free space. Who can help me to remove it.
Phyton problem
14 Answers
+ 7
Sardorbek Karimov ,
are you sure that the space is at the end of the printed output? i can't find this there, but at the end of the first line there is a space.
this is the raw string that is sent to the output: '* \n**\n***\n****'
+ 4
Hi Sardorbek!
Always remember to share your code with the community to solve your problem easily. Otherwise, it's kinda hard to guess what you're trying to achieve.
Most probably, you're adding an additional space between quotes(") and the last character of your output variable. You can remove that space if my statement is correct.
+ 4
Sardorbek Karimov Please post your code here
+ 3
print("""*
**
***
****""")
We're getting its output like this
*
**
***
****
But, what you're trying to print?
You want to print an (") in your output?
+ 3
Calvin Thomas thanks 👍🏻👍🏻it works. But I don't learn about if range in like this code. So I have problem😅.
+ 3
Sardorbek Karimov How about this? :-
i = 1
while i < 5:
print("*" * i)
i += 1
# Hope this helps
+ 3
Calvin Thomas while did not work but if good one👍🏻
+ 2
JUMP_LINK__&&__Python__&&__JUMP_LINK Learner Calvin Thomas this is code
print("""*
**
***
****""");
There is free space in the end of output
+ 2
JUMP_LINK__&&__Python__&&__JUMP_LINK Learner I want to take output like this
*
**
***
****
No free space in this place
+ 2
Lothar I am sure. Also JUMP_LINK__&&__Python__&&__JUMP_LINK Learner have the same output like me
+ 2
for i in range(1, 5): print("*" * i)
# Hope this helps
+ 2
Sardorbek Karimov Works now
+ 2
Calvin Thomas ok no problem👌
- 2
🤟