
python
u010969626
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
python学习
import math def main(): print ("this program find the real solution to a quadratic") a, b, c=eval(input("please input the coefficients(a,b,c):")) delta=b*b-4*a*c if delta>=0:原创 2017-05-01 19:03:22 · 261 阅读 · 0 评论 -
二次方程求解
import math def main(): print ("let us find the solution to a quadratic\n") a, b, c=eval(input("please input the coefficients(a,b,c):")) delta=b*b-4*a*c if a==0: x=-b/c原创 2017-05-01 19:17:39 · 348 阅读 · 0 评论 -
python随机模块
import random x=random.randint(1,6) y=random.choice(["apple","banana","cherry","durian"]) print(x,y)原创 2017-05-03 13:51:41 · 374 阅读 · 0 评论 -
python异常处理
s=input("enter an integer:") try: i=int(s) print("valid integer entered:",i) except ValueError as err: print(err) while True: try: x=int(input("Please enter a number:"))原创 2017-05-03 14:49:01 · 665 阅读 · 0 评论