码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2018-12-15 22:33:52      阅读:257      评论:0      收藏:0      [点我收藏+]

标签:turn   span   解释   control   odi   解释器   python   oat   代码   

  • 规划文件目录:

/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代码)

标签:turn   span   解释   control   odi   解释器   python   oat   代码   

原文地址:https://www.cnblogs.com/scholarly/p/10125095.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!