首页 > 其他 > 详细

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

时间:2018-12-15 22:21:49      阅读:165      评论:0      收藏:0      [点我收藏+]
  • 规划文件目录:

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

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!