Python Forum
Methods that return the highest score from the list
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Methods that return the highest score from the list
#7
(Mar-24-2019, 11:20 PM)Larz60+ Wrote: It's all one program. It's fine if not combined into a class, but the rules are a bit different. Things have to defined before being used. The gamePlayersList error is fixed, the f error is a new error. since python is interpreted, you only see errors as they are encountered. The error you are getting now is because you are trying to use f before it's defined:
 hree_highest_scores(max(gamePlayersList), max(f), max(x)) 
you are mixed up on what goes where. a, b, and c are attributes of the function Three_highest_scores. Inputs if you will, not outputs. for outputs, you return values, which can be modified input values you are trying to assign values to the input arguments of the function from within the function, that's now how it's done. consider the following:
 def ziggy(a, b): return a + b print(ziggy(2, 4)) 
output:
Output:
6
a and b are input arguments, you must supply these values the function adds a and b and returns the result
Thanks man ! It really did solve my problem and finally worked Smile
Reply


Messages In This Thread
RE: Methods that return the highest score from the list - by erfanakbari1 - Mar-25-2019, 10:51 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to update score value? Mavoz 5 2,575 Nov-08-2022, 12:37 AM
Last Post: Mavoz
  How to sort a list with duplicates and return their unique indices. Echoroom 3 3,606 Sep-23-2022, 07:53 AM
Last Post: deanhystad
  Return the sum of the first n numbers in the list. pav1983 3 4,201 Jun-24-2020, 03:37 AM
Last Post: deanhystad
  How to assign a "Score" variable to each element in a list Reta 5 5,413 May-16-2019, 01:13 PM
Last Post: ichabod801
  Return not vowels list erfanakbari1 2 2,736 Mar-26-2019, 11:37 AM
Last Post: perfringo
  List not passing between methods inside a class definition ijosefson 5 4,515 Oct-15-2017, 07:15 PM
Last Post: ijosefson
  how to get the highest monthly average temperature? nikhilkumar 2 7,100 Jul-25-2017, 02:33 PM
Last Post: DeaD_EyE
  Returning the highest value out of 3 values ComputerSkillet 2 3,900 Apr-28-2017, 03:16 AM
Last Post: volcano63
  Numerically determining the highest a ball travels when shot straight up JakeWitten 3 3,463 Apr-22-2017, 04:37 PM
Last Post: Ofnuts
  Average score MartinEvtimov 5 6,931 Apr-02-2017, 07:35 PM
Last Post: ichabod801

Forum Jump:

User Panel Messages

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