Tag: print also has parentheses otherwise BSP input Python python function definition
One, the heart chicken soup:
Jingliyang Quotes:
1, as long as you today than yesterday's you have progress, that is progress.
2, smart and stupid is only relative, you are smarter than you are smarter, you are not stupid is the most stupid.
Second, the simple function exercises:
A simple description of the Python function:
The so-called function, in fact, is to encapsulate some functions, used in the subsequent call.
User input number 0-100
Program Judgment:
Digital >90, score of a
Digital >80, score B
Digital >60, score C
Digital <60 with a score of D
Trying to do it with a function?
def yyy (score): # defines a function with the name yyy, and the value in parentheses can be any other name. if score > score < 0: # Determine if the number entered is greater than 100 or less than 0 print (' illegal ') elif score >=: #当输入的数字大于等于90分时 print (' A ') elif score >=: #当输入的数字大于等于80分时 print (' B ') elif score >=: #当输入的数字大等于于70分时 print (' C ') elif score >=: #当输入的数字大于等于60分时 print (' C ') else: # otherwise less than 60 tick print (' D ') while True: # Let the user loop output an integer score = int (input (' score: ')) yyy (Score) # when calling the function, use the function body name in parentheses. The name in the parentheses must correspond to the variable name of the input value.
day4-"Python Functions"