I want end="" to stop after it has removed all the spaces between integers.
The result I get is this:
106111104110word
but I want to get this:
106111104110 word
Code:
name = 'john' for char in name: print(ord(char), end="") print("word")
store your answer in a variable, and then print. Other answers in this thread work too, but this way you can also use the result.
name = 'john' result = "" for char in name: result += str(ord(char)) print(result) print("word")
Add \n in your code:
\n
name = 'john' for char in name: print(ord(char), end="") print("\nword")
You could do this:
name = 'john' for char in name: print(ord(char), end="") print() print("word")
name = 'john' result = ""
for char in name: result += str(ord(char))
print(result) `println() print("word")
or you can use /n :
')
Copyright © 2021 Jogjafile Inc.
store your answer in a variable, and then print. Other answers in this thread work too, but this way you can also use the result.