摘要: 1 #coding:utf-8 2 import os 3 import tkinter as tk 4 from tkinter import filedialog 5 root = tk.Tk() 6 root.withdraw() 7 8 file_path = filedialog.askdirectory() 9 file_path =file_path+'/... 阅读全文
posted @ 2018-07-06 20:20 三木三水 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 1 '''a,b=0,1 2 x=int(input('请指定需要多少项:')) 3 while x>0: 4 print(b) 5 a,b=b,a+b 6 x-=1''' 7 #递归 8 def fibo(n): 9 if n<=1: 10 return 1 11 else: 12 return fibo... 阅读全文
posted @ 2018-07-05 20:54 三木三水 阅读(197) 评论(0) 推荐(0) 编辑
摘要: 1 import calendar 2 year = int(input('请输入要查询的年份:')) 3 month = int (input('请输入要查询的月数:')) 4 print (calendar.month(year,month)) 阅读全文
posted @ 2018-07-04 18:21 三木三水 阅读(299) 评论(0) 推荐(0) 编辑
摘要: 1 import time,sys,os 2 while(1): 3 t = time.strftime('%Y-%m-%d\n%H:%M:%S',time.localtime(time.time())) 4 print(t) 5 sys.stdout.flush() 6 time.sleep(1) 7 os.system('cls')#windows命令... 阅读全文
posted @ 2018-07-03 19:40 三木三水 阅读(555) 评论(0) 推荐(0) 编辑
摘要: 1 for i in range(1,10): 2 for j in range(1,i+1): 3 print('{}*{}={}\t'.format(i,j,i*j),end='') 4 print() 阅读全文
posted @ 2018-07-02 22:02 三木三水 阅读(185) 评论(0) 推荐(0) 编辑
摘要: 1 def wd(): 2 w=input('请输入一个摄氏温度或者一个华氏温度,如,34c/C or 34f/F:') 3 if w[-1] in ['c','C']: 4 w=float(w[:-1]) 5 hs=1.8*w+32 6 print('华氏温度:{:.2f}F'.format(hs)) 7 e... 阅读全文
posted @ 2018-07-01 21:15 三木三水 阅读(817) 评论(0) 推荐(0) 编辑
摘要: 1 import math 2 def y(): 3 a,b,c=map(float,input('请输入一元二次方程式ax^2+bx+c=0,abc的值,用空格隔开:').split()) 4 d=math.pow(b,2)+4*a*c 5 if a!=0 and d>=0: 6 x1=(math.sqrt(d)-b)/(2*a) 7 ... 阅读全文
posted @ 2018-06-30 08:31 三木三水 阅读(1333) 评论(0) 推荐(0) 编辑
摘要: 1 def j(): 2 a,b,c=map(float,input('请输入三角形三条边的长度,用空格隔开:').split()) 3 if a>0 and b>0 and c>0 and a+b>c and a+c>b and b+c>a: 4 l=a+b+c 5 p=l/2 6 s=p*(p-a)*(p-b)*(p... 阅读全文
posted @ 2018-06-29 00:17 三木三水 阅读(5406) 评论(0) 推荐(0) 编辑