while循環,習題33,笨辦法學python

def worker_salary(target_salary, increase_per_month):
 initial_salary = 0
 money_all_he_got = []
 
 while initial_salary < target_salary:
  print "At the moment, his salary is %d" % initial_salary
  money_all_he_got.append(initial_salary)
  initial_salary += increase_per_month
  print "the money he has now, is:", money_all_he_got
  
 return money_all_he_got
 
print "\there's min's salary information"
target_salary = 20000
increase_per_month = 1000
ming = worker_salary(target_salary, increase_per_month)
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章