笔记
文章平均质量分 64
cyjgfs
这个作者很懒,什么都没留下…
展开
-
Python练习题 Day5
Python练习题 Day5practice 1编写Python程序检查文件是否存在import os.pathopen('abc.txt', 'w') # 创建一个只读文件print(os.path.isfile('abc.txt'))practice 2编写Python程序来确定Python shell是在操作系统上以32位模式执行还是64位模式执行import structprint(struct.calcsize("P") * 8)# P表示void *(通用指针)。在32原创 2021-03-24 13:52:12 · 140 阅读 · 0 评论 -
Python练习题 Day4
Python练习题 Day4practice 1写一个Python程序来计算两个正整数的最大公约数def max_commen_num(a, b): num = 0 # 初始化一个公约数,方便后续进行赋值 if a % b == 0: return b # 这里如果a除b余数为0,那么b就是a的最大公约数 for i in range(int(b / 2), 0, -1): # 这里是指从b/2到0,步数为1倒着数 if a % i ==原创 2021-03-23 14:13:33 · 175 阅读 · 0 评论 -
Python练习题 Day3
Python练习题 Day3practice 1编写Python程序,判断给定的数字是偶数还是奇数,并向用户输出判断结果。def even_or_odd(numb): if numb % 2 == 0: return '该数字为偶数' else: return '该数字为奇数'print(even_or_odd(-9))print(even_or_odd(444))practice 2编写一个Python程序来计算列表中出现多少个4。de原创 2021-03-22 11:08:48 · 320 阅读 · 0 评论 -
python练习题 Day2
Python练习题 Day2practice1编写Python程序打印Python内置函数的文档(语法、描述等)。样本函数:abs()预期结果:abs(数字)–>数字返回参数的绝对值。print(abs.__doc__)practice2编写一个Python程序打印给定月份和年份的日历。注意:使用’calendar’模块。import calendary = int(input("请输入年份:"))m = int(input("请输入月份:"))print(calenda原创 2021-03-18 15:48:55 · 1008 阅读 · 12 评论 -
python练习题 Day1
python练习题 Day1Write a Python program to print the following string in a specific format (see the output). Go to the editorSample String : “Twinkle, twinkle, little star, How I wonder what you are! Up above the world so high, Like a diamond in the sky. T原创 2021-03-16 17:45:43 · 339 阅读 · 2 评论 -
使用pycharm连接mysql进行可视化操作遇到的问题。
使用pycharm连接mysql进行可视化操作遇到的问题。一:社区版与专业版。①:社区版。刚开始尝试的是社区版pycharm进行连接,要自行下载工具。具体操作如下、1:file–>settings2:在plugins中搜索database3:点击搜索4:选中要下载的数据库,点击右边的安装并重启。我这里已装好,无安装键。后续操作与专业版一致。②:专业版专业版已安装了database。直接进行连接即可。操作如下。1:点击界面右上角的database。2:依次点击DataSo原创 2020-09-21 15:13:58 · 477 阅读 · 0 评论