Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

printのendって初めて知った! #16

Open
higurashi-takuto opened this issue Feb 21, 2019 · 3 comments
Open

printのendって初めて知った! #16

higurashi-takuto opened this issue Feb 21, 2019 · 3 comments

Comments

@higurashi-takuto
Copy link
Member

Code Author: @kumbikumbiSIC
Knock Number: 00
print()で改行しないってこうやってやるんすね。初めて知った。
あと、方法1と近くなっちゃうかもしれないけど、わざわざlen()から引かないでprint(msg[-(i+1)], end="")の方がスマートかも。

print(msg[len(msg) - (i + 1)], end = "")

@Hikaru-Morita
Copy link
Member

https://www.lifewithpython.com/2013/12/python-print-without-.html
これを参考にしました。

そっち方が絶対いいですね、まだ配列に負の値を使う発想がスッと出てこない…

@Hikaru-Morita
Copy link
Member

すみません、間違えてクローズしました。

修正しました。

@Hikaru-Morita Hikaru-Morita reopened this Feb 21, 2019
@higurashi-takuto
Copy link
Member Author

配列とか、スライスをずっと使ってると、慣れてくると思うよー

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants