Home > other >  For bosses to help look at this!!!!!! In python thank you!!!!!
For bosses to help look at this!!!!!! In python thank you!!!!!

Time:11-02

Of new clue!!!!!! I can only think of with a branch if but so that the process is too long!!!!!

CodePudding user response:

Stick your code out to have a look at your first train of thought

CodePudding user response:

List=[]
For I in range (5) :
S=input ()
List. Append (s)
Print (list)
List2=[]
For I in list:
If i<60:
Print (I)
The else:
List2. Append (I)
B=len (list2)
Sum=0
For n in list2:
Sum=sum + n
Business=sum/b
Print (business)
It seems not simple

CodePudding user response:

Full_info=[]

For the x in the range (1100) :

Info=input (" % d a name and score separated with a space, the end of the input: exit \ n "% x)

If the info=="exit" :
Break

Full_info. Append (info. The split ())


Print (" failed the list: ")
[print (" name: ", [0], x x [1], "points") for x in full_info if (int (x [1]) & lt; 60)]

Print (" pass the number average: ")
L=[int (I) [1] for I full_info in the if (int (I [1]) & gt;=60)]
Print (sum (l)/len (l), "points")

CodePudding user response:

Full_info=[]

For the x in the range (1100) :

Info=input (" % d a name and score separated with a space, the end of the input: exit \ n "% x)

If the info=="exit" :
Break

Full_info. Append (info. The split ())


Print (" failed the list: ")
[print (" name: ", [0], x x [1], "points") for x in full_info if (int (x [1]) & lt; 60)]

Print (" pass the number average: ")
L=[int (I) [1] for I full_info in the if (int (I [1]) & gt;=60)]
Print (sum (l)/len (l), "points")

CodePudding user response:

reference 4 floor JMZL response:
full_info=[]

For the x in the range (1100) :

Info=input (" % d a name and score separated with a space, the end of the input: exit \ n "% x)

If the info=="exit" :
Break

Full_info. Append (info. The split ())


Print (" failed the list: ")
[print (" name: ", [0], x x [1], "points") for x in full_info if (int (x [1]) & lt; 60)]

Print (" pass the number average: ")
L=[int (I) [1] for I full_info in the if (int (I [1]) & gt;=60)]
Print (sum (l)/len (l), "points")

Code can also be less, but fear you don't understand is divided
  • Related