Python 第9页
世界上最好的编程语言(
【递归】快速幂 - AI科研 编程 读书笔记 - 小竹の笔记本

【递归】快速幂

class Solution:    def myPow(self, x: float, n: int) -> float:        if n==0:            return 1        if n==1:            return x        if n==-1:  ...
SmallBamboo的头像 - AI科研 编程 读书笔记 - 小竹の笔记本SmallBamboo1年前
01509
【模拟】回文日期 - AI科研 编程 读书笔记 - 小竹の笔记本

【模拟】回文日期

题目 我的代码 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...
SmallBamboo的头像 - AI科研 编程 读书笔记 - 小竹の笔记本SmallBamboo1年前
01687
【Python】学生信息管理系统示例 - AI科研 编程 读书笔记 - 小竹の笔记本

【Python】学生信息管理系统示例

import os.path  #导入os.path模块 def menm():    #菜单    print('==========================学生信息管理系统==========================')    print('----------------------------...
SmallBamboo的头像 - AI科研 编程 读书笔记 - 小竹の笔记本SmallBamboo1年前
01659
【递归】2的幂 - AI科研 编程 读书笔记 - 小竹の笔记本

【递归】2的幂

递归法: class Solution:    def isPowerOfTwo(self, n: int) -> bool:        if n==1:            return True        if n<=0 or n%2!=0:            return Fals...
SmallBamboo的头像 - AI科研 编程 读书笔记 - 小竹の笔记本SmallBamboo1年前
016411
【Python】第一次实验 - AI科研 编程 读书笔记 - 小竹の笔记本

【Python】第一次实验

1 # 1、编写程序,生成一个包含20个随机整数的列表,然后对其中偶数下标的元素进行降序排列,奇数下标的元素不变。(提示:使用切片。) ​ import random l1 = [random.randint(1,100) for i i...
SmallBamboo的头像 - AI科研 编程 读书笔记 - 小竹の笔记本SmallBamboo1年前
01546