python入门与爬虫数据分析 笔记

python入门与爬虫数据分析 笔记 by:IT私塾

趁着假期,稍微系统地熟悉一下python

python 入门

# -*- coding = utf-8 -*-
# @Author : wangxx
# @Time : 2022/1/28 17:56
# @File : text220128.py
# @Software : PyCharm

# my first product
print ("hello,world") # 单行注释 和别的编译器一样的快捷键 ctrl+/

'''
all right i get it
'''

a = 10
print(a)
print("strint" , a) # 变量可以是任意的数据类型。

age = 18
print("%d"%age) # 格式化输出

print("我的名字是%s,你的名字是%s"%("张三","王二"))
print("aaa","bbb","ccc")
print("www","baidu","com",sep=".") #sep分割,直接超链接
# "\t" 空格 "\n" 换行
print("hello",end="") # 不写不换行

有关不同符号类型的占位符,正好有点遗忘,做个记录

%c 单个字符 char
%s 字符串:通过str()字符串转换来格式化 string
%d 有符号十进制整数 int
%u 无符号十进制整数 unsigned int
%f 浮点数 float
%b 二进制整数
%o 八进制整数
%x 十六进制整数(小写字母)
%X 十六进制整数(大写字母)
%e 指数(基底e)
%E 指数(基底E)
	-c 和 py 一样的-

%r 字符串:采用repr()的显示
	-似乎只有py有的-

%ld long int
%lld long long int
%hd short
	-py似乎不去考虑整数的大小-
上一篇:Photoshop制作超酷的3D立体字教程


下一篇:photoshop无法编辑png图片无法解锁的解决办法