pycharm
Tom_2018
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
python常识
# print 是一个函数 print("hello") # 控制台输出内容 # 注释快捷键:Ctrl + / type(1) type(1.5) type("hello") # 快速将代码在控制台运行:Alt + Shift + E type('hello') type("""hel lo""") # 转义 print('What\'s your name?') # \n 换行 \t 制表符 print("12\n45\t6\n7\t89") print("12\\n45\\t6\\n7\...原创 2020-05-10 13:47:40 · 220 阅读 · 0 评论 -
把一个数组随机分组
import random num = int(input(('请输入一个数字:\n'))) a = [[], [], [],[]] for i in range(1, num + 1): b = random.randint(0,3) a[b].append(i) for j in a: print(j)原创 2018-12-14 18:27:19 · 2674 阅读 · 0 评论 -
判断闰年
temp = input("请输入一个年份:\n") while not temp.isdigit(): temp = input("抱歉,您输入有误,请输入一个正确的年份:\n") if int(temp)%400==0: print("闰年") else: if int(temp)%4==0 and int(temp)%100!=0: print("闰年...原创 2018-12-14 18:29:19 · 264 阅读 · 0 评论 -
猜一个随机数
import random secret = random.randint(1,10) times =3 guess = 0 print("猜一个数字:",end="") while(guess != secret)and ( times > 0): temp =input() while not temp.isdigit(): temp = input("...原创 2018-12-14 18:31:19 · 366 阅读 · 0 评论 -
Python_learning_summary
0、命令行常用命令 命令行(Windows下叫“命令提示符”,Mac下叫“终端”)里的常用命令。打开命令行,我们会看到每行前面都有诸如 C:\Documents and Settings\Crossin> 或者 MyMacBook:~ crossin$ 之类的。 这个提示符表示了当前命令行所在目录。 第一个常用的命令是: dir (windows环境下) ls ...原创 2019-01-10 10:31:28 · 683 阅读 · 0 评论
分享