排序
【递归】快速幂
class Solution: def myPow(self, x: float, n: int) -> float: if n==0: return 1 if n==1: return x if n==-1: ...
【模拟】回文日期
题目 我的代码 import datetime ipt = input() begin = datetime.datetime(int(ipt[0:4]), int(ipt[4:6]), int(ipt[6:8])) flag1=0 flag2=0 while True: if flag1==1 and flag2==1: brea...
【Python】学生信息管理系统示例
import os.path #导入os.path模块 def menm(): #菜单 print('==========================学生信息管理系统==========================') print('----------------------------...
【递归】2的幂
递归法: class Solution: def isPowerOfTwo(self, n: int) -> bool: if n==1: return True if n<=0 or n%2!=0: return Fals...
【Python】第一次实验
1 # 1、编写程序,生成一个包含20个随机整数的列表,然后对其中偶数下标的元素进行降序排列,奇数下标的元素不变。(提示:使用切片。) import random l1 = [random.randint(1,100) for i i...