码迷,mamicode.com
首页 > 编程语言 > 详细

Python简单计算

时间:2017-02-27 22:04:11      阅读:236      评论:0      收藏:0      [点我收藏+]

标签:python

环境:Python3.5

技术分享

[root@xiaoshui 23:52:22~/test]# ll
total 16
drwxr-xr-x. 2 root root 4096 Feb 22 22:45 sed
-rwxr-xr-x. 1 root root  105 Feb 27 23:47 test01.py
-rw-r--r--. 1 root root   41 Feb 27 23:48 test02.sh
drwxr-xr-x. 2 root root 4096 Feb 27 23:36 tmp3
[root@xiaoshui 23:52:25~/test]# cat test01.py 
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

s1 = 72
s2 = 85
r = s1/s2*100
print(‘rate= %0.2f%%‘ % r)
[root@xiaoshui 23:52:29~/test]# cat test02.sh 
#!/bin/bash

python /root/test/test01.py
[root@xiaoshui 23:52:32~/test]# bash test02.sh 
rate= 84.71%
[root@xiaoshui 23:52:35~/test]#


本文出自 “学無止境” 博客,请务必保留此出处http://dashui.blog.51cto.com/11254923/1901683

Python简单计算

标签:python

原文地址:http://dashui.blog.51cto.com/11254923/1901683

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