Python Forum
Difference between return and print
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Difference between return and print
#10
there are two major versions of python, python2 ans python3. python2 will no longer be supported after the end of 2019 although it will still run if you still have it. it is suggested that all new learning focus on python3.

these two major versions are mostly the same with a few differences. the difference you will first encounter, if you switch over now, is that in python2, print is a statement while in python3, print is a function. python3 has been out for nearly a decade. so, everyone has had plenty of time to learn it and try it. if their scripts don't depend on other code that has not yet been upgraded to python3, then they should be upgrading to python3 real soon, if not already.

you will see many examples of print as a function call, such as post #9 in this topic thread. be ready for it and understand it.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Messages In This Thread
Difference between return and print - by DragonG - Oct-24-2018, 05:56 PM
RE: Difference between return and print - by Skaperen - Oct-26-2018, 12:06 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  What a difference print() makes Mark17 2 600 Oct-20-2023, 10:24 PM
Last Post: DeaD_EyE
  return vs. print in nested function example Mark17 4 1,793 Jan-04-2022, 06:02 PM
Last Post: jefsummers
  output while using return instead of print muza 2 2,152 Apr-23-2020, 09:38 AM
Last Post: muza
  Error with print and return commands TheDark_Knight 2 1,970 Jan-15-2020, 04:59 PM
Last Post: TheDark_Knight
  Embedding return in a print statement Tapster 3 2,312 Oct-07-2019, 03:10 PM
Last Post: Tapster
  print 3 return values from function bluefrog 5 5,290 Mar-05-2017, 07:58 PM
Last Post: wavic

Forum Jump:

User Panel Messages

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