Home > other >  Introduction to the small white for help
Introduction to the small white for help

Time:09-21

I need to make this program now, but how to show it's corresponding which judges, such as the first line is the judges and the next row is 1 2 judges the third line is 3 judges, that how to set up the code, please help, thank you

CodePudding user response:

Is that so?

 
Judges_num=int (input (' please enter the number of judges: '))

For I in range (judges_num) :
Score=input (" please enter the first {} judges score: '. The format (I + 1))

CodePudding user response:

 num=int (input (" input the number of judges ")) 
Chengji=[]
For I in range (1, int (num) + 1) :
Fen=111
While fen> 100 or fen<0:
Fen=int (input (' the first % d a judges score '% I))
If fen> 100 or fen<0:
Print (' must be real Numbers 0-100 ')
The else:
Chengji. Append (fen)
Print (' removes a high % d % Max (chengji))
Chengji. Remove (Max (chengji))
Print (' remove a minimum points % d % min (chengji))
Chengji. Remove (min (chengji))
Print (' final score. % 2 f '% (sum (chengji)/len (chengji)))

CodePudding user response:

 
N=int (input (' number: please enter the judges'))
I=1
Scores=[]
Score_total=0
While I & lt;=n:
I_score=input (f 'please enter the first {I} judges score:')
Try:
Int_score=int (i_score)
If 0 & lt;=int_score & lt;=100:
Scores. Append (int_score)
Score_total +=int_score
I +=1
The else:
Raise the Exception
Except:
Print (' must be real Numbers 0 ~ 100! ')

Scores. The sort () sort # score

Print (f 'removes a high score: {scores [1]}')
Print (f 'remove a minimum points: {scores [0]}')
Last_score=(score_total - scores [0] - scores [1])/(len (scores) - 2)
Print (f 'final score: {last_score: 2 f}')

CodePudding user response:

The
reference 1 floor So. Ne response:
is that So?

 
Judges_num=int (input (' please enter the number of judges: '))

For I in range (judges_num) :
Score=input (" please enter the first {} judges score: '. The format (I + 1))

Well well, yes, very enlightening
  • Related