I have a Python script that prints some numbers, like this:
results = [42, 21, 64, 32, 16, 8, 4, 2]
for number in results:
print(number, end=' ')
In the console, the output of this script is:
42 21 64 32 16 8 4 2 ⏎
Why is there a weird character at the end?
My IDE is LunarVim. My shell is Fish.
This is essentially fish's way of telling you that there is no trailing newline or "\n". Using print() will probably not result in this. In bash, the terminal may start after the output, instead of the next line.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.