
Lv.1
平平无奇的创作者
签名:啥都不做 就做卡牌
在 【Python作品分享】绘制正方形【作品秀】 中回复
import turtle as t
for x in range(4):
t.forward(100)
t.right(90)
楼主,可以用for循环进行操作。
2023-01-15T10:07:50 点赞:1
在 纠错,求助 中回复
无法运行,现已改完
主程序(main.py)及副程序(lib.prime_num.py)
from lib.prime_num import p_n
if __name__ == "__main__":
s = int(input("scope "))
number = p_n(s+1)
number.prime()
class p_n:
def __init__(self, scope):
self.scope = scope
def prime(self):
for num in range(2, self.scope):
for i in range(2, num):
if num % i == 0:
j = num / i
print('%d 等于 %d * %d' % (num,i,j))
break
else:
print(num, '是一个质数')
2023-04-06T12:53:59 点赞:0
在 【新一代编辑器上线预告】手机电脑都能用的Kitten N要来啦! 中回复
print("太酷啦!!!")
consle.log("太酷啦!!!")
#include <stdio.h>
int main(){
printf("太酷啦!!!");
return 0;
}
#include <iostream>
using namespace std;
int main(){
cout << "太酷啦!!!" << endl;
return 0;
}2023-06-30T12:54:42 点赞:2
在 【Python作品分享】新的作品rwe 中回复
你好棒呀,要不试试我这个吧
import sys
from PyQt5.QtWidgets import QApplication, QMainWindow, QLabel
from PyQt5.QtGui import QPixmap
class MainWindow(QMainWindow):
def __init__(self):
super().__init__()
# 创建标签组件
self.label = QLabel(self)
# 加载并设置图片
pixmap = QPixmap("https://kn-cdn.codemao.cn/wood/image/B1UFfwcuh.jpg")
self.label.setPixmap(pixmap)
# 调整窗口大小以适应图片
self.resize(pixmap.width(), pixmap.height())
if __name__ == '__main__':
app = QApplication(sys.argv)
window = MainWindow()
window.show()
sys.exit(app.exec_())2023-06-30T13:14:24 点赞:0