1. 程式人生 > >old.2.流程梳理(function之return代碼)

old.2.流程梳理(function之return代碼)

another ber color function not .py number cti total

  • 規劃文件目錄:

/me/old/2

/me/solo/control

等等

  • 創建文檔.py,要有解釋器和utf-8編碼,如:
 1 #!/usr/bin/env python
 2 # -*- coding:utf-8 -*-
 3 import getpass
 4 a=getpass.getpass("Enter a number: ")
 5 b=getpass.getpass("Enter another number: ")
 6 def add_num(x,y):
 7   print(a)
 8   print(b)
 9   total=float(x)+float(y)
10   return
total 11 print("This won‘t be printed") 12 print("The sum is: "+str(add_num(a,b))) 13 14 def max_num(x,y): 15 if x>=y : 16 return(x) 17 else: 18 return(y) 19 print("The max is: "+str(max_num(a,b)))
  • 執行代碼:

登錄centos,執行代碼(包括路徑)

./me/solo/function/return.py
  • 調試

old.2.流程梳理(function之return代碼)