Python Forum
How to pass value from method to function
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to pass value from method to function
#12
So the problem I am having, and now i have followed what everyone is saying, is that it is passing None to the function, so after testing, I get on all but the empty list test in my test suite
Unbound error variable 'first' referenced before assignment 
Which implies to me that it is completely missing tie if statements which I don't understand. when i run my original code, it does what I expect, yet take it out of the function and pass it to the function, and it all falls apart.

Have I not converted everything to python3 correctly?

Ah, I have a break through, thank you all for your help, I changed the range x was working on to 0, and another test was passed, it now only fails on an empty list and single item list which is what I was expecting it to do, as I had not written the code to deal with that yet. Thank you very much for your help. I think I nearly get it now.
Reply


Messages In This Thread
RE: How to pass value from method to function - by iFunKtion - May-23-2017, 05:06 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to pass encrypted pass to pyodbc script tester_V 0 962 Jul-27-2023, 12:40 AM
Last Post: tester_V
  i want to use type= as a function/method keyword argument Skaperen 9 2,088 Nov-06-2022, 04:28 AM
Last Post: Skaperen
Question How to pass a method as argument in an another method? anilanvesh 6 2,875 Sep-30-2021, 10:18 PM
Last Post: deanhystad
  Regex - Pass Flags as a function argument? muzikman 6 3,796 Sep-06-2021, 03:43 PM
Last Post: muzikman
  Possible to dynamically pass arguments to a function? grimm1111 2 2,307 Feb-21-2021, 05:57 AM
Last Post: deanhystad
  Building a method name in a function ffgth 9 3,440 Oct-19-2020, 01:21 PM
Last Post: buran
  Do I have to pass 85 variables to function? Milfredo 10 4,497 Sep-26-2020, 10:13 PM
Last Post: Milfredo
  Pass by object reference when does it behave like pass by value or reference? mczarnek 2 2,642 Sep-07-2020, 08:02 AM
Last Post: perfringo
  Pass integers to datetime.date function florian 3 2,808 Jul-18-2020, 04:43 AM
Last Post: scidam
  How to pass multiple arguments into function Mekala 4 2,554 Jul-11-2020, 07:03 AM
Last Post: Mekala

Forum Jump:

User Panel Messages

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