Home > other >  Python topic
Python topic

Time:10-12

Come on everybody, it is good to complete the programming process! (Python function definitions and invoke)

CodePudding user response:

M=(int (input ()) for I in range (int (input ())))
Print (sum (m)/len (m))

CodePudding user response:

 def score () : 
Try:
Num=int (input (" please enter the number of students: "))
A=0
For I in range (1, num + 1) :
S=input (' input the first student score: % d % I)
A +=float (s)

Print (" % d students average can be divided into: % s points "% (num, a/num))
Except the Exception as e:
Print (" input type error, can only input Numbers ")


If __name__=="__main__ ':
Score ()
  • Related