Python Forum
Function not returning correct value
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Function not returning correct value
#2
The return statement is not 'returning' s, because within the function, 's' is 'score' so that is what you would want to return. If you want line 22 to work, you need to modify line 21 to something like ques = question(d, s) then change line 22 to print(ques, "Score")
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply


Messages In This Thread
Function not returning correct value - by TsG009 - Nov-23-2017, 07:56 PM
RE: Function not returning correct value - by sparkz_alot - Nov-23-2017, 11:16 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Can anyone spot why this function is returning an empty list? hhydration 2 1,957 Nov-18-2020, 06:16 AM
Last Post: deanhystad
  Why is this function returning none? wlsa 2 5,942 Sep-30-2018, 01:36 PM
Last Post: gruntfutuk
  Function for returning absolute numbers Ernstblack 2 3,362 Oct-02-2017, 05:48 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

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