Python Forum
Why does absence of print command outputs quotes in function?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Why does absence of print command outputs quotes in function?
#3
You also need to realise that printing and returning are not at all the same. The former writes the value to the standard output stream, so the print function returns None. In the latter case, the value returned is made available to the caller and can hence be used in further computations.
Mark17 likes this post
Reply


Messages In This Thread
RE: Why does absence of print command outputs quotes in function? - by ndc85430 - Jan-04-2022, 07:08 PM

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 1,443 Apr-24-2024, 05:47 AM
Last Post: Bronjer
  print doesnt work in a function ony 2 439 Mar-11-2024, 12:42 PM
Last Post: Pedroski55
  problem with print command in super() akbarza 5 789 Feb-01-2024, 12:25 PM
Last Post: deanhystad
  format json outputs ! evilcode1 3 1,848 Oct-29-2023, 01:30 PM
Last Post: omemoe277
  Formatting outputs created with .join command klairel 2 728 Aug-23-2023, 08:52 AM
Last Post: perfringo
  Python VS Code: using print command twice but not getting output from terminal kdx264 4 1,251 Jan-16-2023, 07:38 PM
Last Post: Skaperen
  How to print variables in function? samuelbachorik 3 1,008 Dec-31-2022, 11:12 PM
Last Post: stevendaprano
  How to print the output of a defined function bshoushtarian 4 1,433 Sep-08-2022, 01:44 PM
Last Post: deanhystad
  I have written a program that outputs data based on GPS signal kalle 1 1,295 Jul-22-2022, 12:10 AM
Last Post: mcmxl22
  return vs. print in nested function example Mark17 4 1,891 Jan-04-2022, 06:02 PM
Last Post: jefsummers

Forum Jump:

User Panel Messages

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