2021-02-16 COMP9021 python第一节课笔记

文章目录

  • magic commands
  • print(s1+s2)和print(s1, s2)的区别
  • help 查看函数说明
  • dir 查看内置函数
  • type 查看数据类型
  • lower 和 upper
  • join 连接函数

magic commands

官网资料:https://ipython.readthedocs.io/en/stable/interactive/magics.html#line-magics
2021-02-16 COMP9021 python第一节课笔记_第1张图片

  • % 一个百分号是 line magic
    例:%automagic

  • %% 两个百分号是 cell magic
    例:%%writefile file_name.py

print(s1+s2)和print(s1, s2)的区别

s1+s2+s3:先计算(s1+s2),然后存起来,再计算(s1+s2)+s3。
t1, t2, t3:直接打印。
2021-02-16 COMP9021 python第一节课笔记_第2张图片

help 查看函数说明

注:不需要加括号
2021-02-16 COMP9021 python第一节课笔记_第3张图片

dir 查看内置函数

2021-02-16 COMP9021 python第一节课笔记_第4张图片

type 查看数据类型

在这里插入图片描述

lower 和 upper

2021-02-16 COMP9021 python第一节课笔记_第5张图片

join 连接函数

2021-02-16 COMP9021 python第一节课笔记_第6张图片
博主我太懒了…

你可能感兴趣的:(GSOE9210,python,jupyter)