Last active
October 21, 2020 10:28
-
-
Save zoltanctoth/bcba05b7edc9852a9ee810013ab6693f to your computer and use it in GitHub Desktop.
Python print without newline. This script shows how you can use python to print a string without adding a newline.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Print a string without adding a newline | |
print("Hey, Python prints without a newline.", end ="") | |
# Alternative solution | |
import sys | |
sys.stdout.write("Hey, Python prints without a newline.") | |
# You are part of an experiment on how well gists can be used as "StackOverflow". | |
# Please add a comment or a star if you found this useful. :) Thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment