文章分类 -  Python

摘要:#-*- encoding: utf-8 -*- ''' try.py Created on 2019/1/20 16:48 Copyright (c) 2019/1/20, IT_BULL版权所有. @author: IT_BULL ''' import time import smtplib from email.header import Header from email.mime.t... 阅读全文
posted @ 2019-01-20 18:50 马鞍山 阅读(257) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2018-04-10 14:58 马鞍山 阅读(3101) 评论(0) 推荐(0)
摘要:def go(i): if 0 == i: return else: print("递归_head", i - 1) go(i - 1) print("递归_foot",i - 1) go(3) # 结果 # 递归_head 2 # 递归_head 1 # 递归_head 0 # 递归_foot 0 # 递归_foo... 阅读全文
posted @ 2018-04-01 12:38 马鞍山 阅读(320) 评论(0) 推荐(0)
摘要:鸡兔同笼 阅读全文
posted @ 2018-02-19 23:57 马鞍山 阅读(6240) 评论(0) 推荐(0)
摘要:1 #3x+4y = 100 求 x = ? ,y = ? 2 3 x = 0 4 while x <= (100//3): 5 if(100 - 3*x) % 4 == 0: 6 y = (100 - 3*x) // 4 7 print("共有解:x的值是 %d,y的值是 %d"%(x,y)) 8 x +=1 9 10 # ... 阅读全文
posted @ 2018-02-19 17:34 马鞍山 阅读(2262) 评论(0) 推荐(0)
摘要:1 import os 2 #死循环用法 3 4 while True: 5 control = input("请输入计算机操作指令(Windows)") 6 if(control =='控制面板'): 7 os.system("control") 8 elif(control == '电脑配置'): 9 os.syst... 阅读全文
posted @ 2018-02-19 16:58 马鞍山 阅读(286) 评论(0) 推荐(0)
摘要:运行结果: 3位数中水仙花数有 1533位数中水仙花数有 3703位数中水仙花数有 3713位数中水仙花数有 407计算3位数中的水仙花数花费时间 0 秒4位数中四叶玫瑰数有 16344位数中四叶玫瑰数有 82084位数中四叶玫瑰数有 9474五位的五角星数共有 54748五位的五角星数共有 927 阅读全文
posted @ 2018-02-19 16:21 马鞍山 阅读(1009) 评论(0) 推荐(0)
摘要:1 #回文判断 2 a = eval(input("请输入一个数判断是否是回文")) 3 4 # if a =100: 5 if (a // 100 > 0) and (a // 100 < 10) : 6 gewei = a % 10 7 shiwei = a // 10 % 10 8 baiwei = a // 100 9 print(ge... 阅读全文
posted @ 2018-02-19 14:32 马鞍山 阅读(547) 评论(0) 推荐(0)
摘要:python 语音合成模块pywin32 阅读全文
posted @ 2018-02-18 19:16 马鞍山 阅读(368) 评论(0) 推荐(0)
摘要:随机字符,随机字符串,随机数字 阅读全文
posted @ 2018-02-17 23:52 马鞍山 阅读(457) 评论(0) 推荐(0)
摘要:错误姿势: 请输入1个数Traceback (most recent call last): File "D:/Python/day2/input.py", line 2, in <module> x = eval(input("请输入1个数")) File "<string>", line 0 ^ 阅读全文
posted @ 2018-02-17 18:11 马鞍山 阅读(11782) 评论(0) 推荐(0)
摘要:1 import turtle 2 # 绘制五角星 3 turtle.pensize(5) 4 turtle.color("red") 5 turtle.write("0,0") 6 turtle.forward(300) 7 8 # 改变方向 9 for i in range(4): 10 turtle.right(144) 11 turtle.forwar... 阅读全文
posted @ 2018-02-17 00:17 马鞍山 阅读(2458) 评论(0) 推荐(0)
摘要:#_*_coding:utf-8_*_ import turtle #启动一个绘图窗口 # turtle.showturtle() # #写入内容 # turtle.write("0,0" # #移动100个像素 # turtle.forward(100) # #向右边旋转90度 # turtle.right(90) # turtle.forward(100) # turtle.right(90... 阅读全文
posted @ 2018-02-16 22:16 马鞍山 阅读(282) 评论(0) 推荐(0)
摘要:python缩进是4个空格为一个缩进,请勿使用tab和空格混合缩进。 阅读全文
posted @ 2018-01-25 17:17 马鞍山 阅读(157) 评论(0) 推荐(0)