Python Forum
Print("") vs Print(end="\n")
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Print("") vs Print(end="\n")
#1
While I tested, who fast some functions are, I tested the "print" function.
So I found out that print(end="\n") is faster.
Is there any reason then to use print("")
Reply
#2
There is no reason to use print('', end'\n') instead of plain print(''). Printing to the console is for human beings. We are unable to catch the difference. We are slow readers. This can't slow your program significantly.
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to Randomly Print a Quote From a Text File When User Types a Command on Main Menu BillKochman 13 809 Yesterday, 05:47 AM
Last Post: Bronjer
  print doesnt work in a function ony 2 303 Mar-11-2024, 12:42 PM
Last Post: Pedroski55
  print(0.1+0.2==0.3) akbarza 3 401 Mar-04-2024, 02:02 PM
Last Post: Gribouillis
  problem with print command in super() akbarza 5 595 Feb-01-2024, 12:25 PM
Last Post: deanhystad
  problem with spliting line in print akbarza 3 389 Jan-23-2024, 04:11 PM
Last Post: deanhystad
  problem with print lists MarekGwozdz 4 689 Dec-15-2023, 09:13 AM
Last Post: Pedroski55
  What a difference print() makes Mark17 2 569 Oct-20-2023, 10:24 PM
Last Post: DeaD_EyE
  elif not responding on print EddieG 3 871 Jul-20-2023, 09:44 PM
Last Post: Pedroski55
  print(data) is suddenly invalid syntax db042190 6 1,204 Jun-14-2023, 02:55 PM
Last Post: deanhystad
  How do you get Python to print just one value in a list? 357mag 3 1,018 May-17-2023, 09:52 PM
Last Post: rob101

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020