摘要: 1. 找出10000以内能被5或6整除,但不能被两者同时整除的数(函数) def find_numbers(): result = [] for i in range(1, 10000): if (i % 5 == 0 or i % 6 == 0) and not (i % 5 == 0 and i 阅读全文
posted @ 2024-04-08 12:00 青鸢..i 阅读(12) 评论(0) 推荐(0) 编辑
摘要: 1,求一个十进制的数值的二进制的0、1的个数 def count_binary_digits(num): binary = bin(num)[2:] count_0 = binary.count('0') count_1 = binary.count('1') return count_0, cou 阅读全文
posted @ 2024-03-28 16:46 青鸢..i 阅读(4) 评论(0) 推荐(0) 编辑
摘要: 用户登录注册案例 1.def register(): username = input("请输入用户名:") password = input("请输入密码:") with open("users.txt", "a") as f: f.write(f"{username} {password} ") 阅读全文
posted @ 2024-03-21 21:15 青鸢..i 阅读(10) 评论(0) 推荐(0) 编辑
摘要: 1. 打印课堂上图案 layer=int(input("需要打印的层数:")) for i in range(1,layer+1): for j in range(i): print("*",end="") print() 直角三角形右 layers = int(input("请输入要打印的层数:" 阅读全文
posted @ 2024-03-21 20:26 青鸢..i 阅读(5) 评论(0) 推荐(0) 编辑
摘要: 1.五个ppt界面打印 ① print(' 英雄联盟商城登录界面') print("~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~") print(" 1.账号登录") print(" 2.新用户注册") print(" 3. 退出 阅读全文
posted @ 2024-03-13 21:49 青鸢..i 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 交换变量的方法: 1 2 3 阅读全文
posted @ 2024-03-13 21:29 青鸢..i 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 首先进入python官网(当然 我们这里所说的python指的是python3,因为如今python2已经停止更新 更多的python开发者也会选择python3,这篇博客也是python3环境的搭建) Python 官网:https://www.python.org/ 选择windows版本,我们 阅读全文
posted @ 2024-03-10 22:43 青鸢..i 阅读(14) 评论(0) 推荐(0) 编辑
摘要: <style> *{ margin:0; padding:0; } img{ width:500px; height:300px; display:none; } ul{ list-style:none; } ol{ width:150px; height:20px; background-colo 阅读全文
posted @ 2024-01-17 20:29 青鸢..i 阅读(6) 评论(0) 推荐(0) 编辑
摘要: <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title></title> <style> *{ margin:0; padding:0; } </style> </head> <body> <script> const img_w 阅读全文
posted @ 2024-01-17 16:45 青鸢..i 阅读(3) 评论(0) 推荐(0) 编辑
摘要: <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title></title> <style> div{ width:100px; height:100px; background-color:aquamarine; } </style> 阅读全文
posted @ 2024-01-17 16:42 青鸢..i 阅读(6) 评论(0) 推荐(0) 编辑