最新发布第34页
排序
【Python】第三次实验
1 def f(n): # 根据n的值分类讨论 if n < 1: return n elif 1 <= n < 10: return 2*n-1 else: return 3*n-11 print(f(5)) 2 def is_palindrome(s): # i循环字符串s的一半 for i in ran...
【Python】第二次实验
1 # 用Python编写程序,输入一年份,判断该年份是否是闰年并输出结果。 year = int(input('判断闰年,请输入年份:')) if year % 4 == 0 and year % 100 != 0: print(f'{year}是闰年') elif yea...
【Python】PySide6应用如何防止网络请求阻塞窗口的响应
Q:在开发PySide6的应用时,进行网络请求时会导致整个窗口卡死,当目标服务器宕机时,会导致客户端的窗口完全无响应,请问如何让网络请求不影响窗口? A:遇到这个问题,通常的解决方案是将网络...
【Python】在Windows Server上部署Flask后端服务器
想要在Windows Server上部署flask应用,当然不能只下一个anaconda配完环境之后直接启动py文件,这样的话后台会有一段警告: * Serving Flask app 'app' * Debug mode: off WARNING: This is a d...
【C】while(y–);/while(y++);最终y是多少?
while(y--) #include <stdio.h> int main(){ int y=10; while(y--); printf('%d',y); return 0; } 答案:无论y一开始是多少,最终y都等于-1。 为什么? 因为非0即真+对于一个数如果一直+或者...
【C】宏定义拓展
唉,还是要拓展一下宏定义,不能只知道#define PI 3.14乐。 第一个例子,'##' #include <stdio.h> #define f(g,g2) g##g2 int main(){ int var12=100; printf('%d',f(var,12)); return 0; } ...