Python Forum
Error with print and return commands
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error with print and return commands
#3
(Jan-15-2020, 04:06 PM)stullis Wrote: The return keyword terminates the function. You'll need the print() call prior to return.

Thanks for the response. This helped me learn a new thing.
However, does it mean that it's never possible to have an output consisting of a number + text, using the return command? For e.g. 10 chocolates?
Reply


Messages In This Thread
RE: Error with print and return commands - by TheDark_Knight - Jan-15-2020, 04:59 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Receiving this error in my "response" and causes script to return wrong status cubangt 18 2,091 Aug-13-2023, 12:16 AM
Last Post: cubangt
  Print Error DaveG 1 1,101 Apr-07-2022, 03:10 AM
Last Post: deanhystad
  return vs. print in nested function example Mark17 4 1,758 Jan-04-2022, 06:02 PM
Last Post: jefsummers
  return out of loops syntax error felixf 7 3,467 Nov-03-2020, 01:00 PM
Last Post: perfringo
  SystemError: error return without exception set!!! faryad13 3 3,706 Oct-23-2020, 02:32 PM
Last Post: ATARI_LIVE
  syntax error on return statement l_butler 5 3,125 May-31-2020, 02:26 PM
Last Post: pyzyx3qwerty
  output while using return instead of print muza 2 2,132 Apr-23-2020, 09:38 AM
Last Post: muza
  I am getting an Error, and not sure why? My goal is to print out rahulne22 7 3,081 Dec-01-2019, 03:53 PM
Last Post: snippsat
  Python Error 'return self.attrs[key]' Need help! ahmedwaqas92 0 4,449 Oct-13-2019, 03:50 AM
Last Post: ahmedwaqas92
  Embedding return in a print statement Tapster 3 2,297 Oct-07-2019, 03:10 PM
Last Post: Tapster

Forum Jump:

User Panel Messages

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