Python Forum
Passing parameters with arrays and array definitions
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Passing parameters with arrays and array definitions
#1
from array import *

# Must locate and return the smallest value from a list
def find_smallest():
    pass
    

# Must locate and return the largest value from a list
def find_largest():
     pass
    

# Must ask for scores and return them as a list
def get_scores(a):
    for i in range (0,6) :
      input("Please input the scores",a[i])
    return a  

# print title

print("Diving Scores 1b")

scores = array('i', [ 1,2,3,4,5,6,7] )


for j in range (0,6) : 
    print(" The scores are",get_scores(scores[j]))




# Request all 7 scores - call get_scores()

# Request the degree of difficulty - includes decimals (no error checking required)

# calculate and display the final score 
I am not sure how to pass parameters with an array and how to define the input in the function.
Larz60+ write Jul-07-2022, 09:42 PM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Fixed for you this time. Please use BBCode tags on future posts.
Reply


Messages In This Thread
Passing parameters with arrays and array definitions - by michael_lwt - Jul-07-2022, 01:56 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Variable definitions inside loop / could be better? gugarciap 2 1,441 Jan-09-2024, 11:11 PM
Last Post: deanhystad
  Definitions in User-Created Functions and For Loops new_coder_231013 6 3,533 Dec-29-2021, 05:51 AM
Last Post: ndc85430
  Element misalignment passing numpy array with distutils OTAGOHARBOUR 1 2,685 Dec-06-2019, 01:47 AM
Last Post: OTAGOHARBOUR
  'Get closest value array in array of arrays.' follow up help. DreamingInsanity 10 11,158 Dec-05-2019, 06:30 PM
Last Post: DreamingInsanity
  Get closest value array for array of arrays. DreamingInsanity 2 3,587 Nov-18-2019, 03:55 PM
Last Post: DreamingInsanity
  Passing parameters to SQL Server using pandas Ilangos 8 19,892 Jun-03-2019, 11:25 AM
Last Post: Ilangos
  How do I split a large array into smaller sub-arrays? codebeacon 3 5,296 Apr-08-2019, 03:45 AM
Last Post: codebeacon
  how to work with variables changed in definitions Prof_Jar_Jar 2 3,400 Dec-16-2018, 12:04 AM
Last Post: Prof_Jar_Jar

Forum Jump:

User Panel Messages

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