Python快速学习第二课

#coding=utf-8
'''
Created on 2018年9月8日

@author: Administrator

本章知识点:
基本数据类型
    复数类型
    bool类型存储
基本的数据结构

基本的函数使用
'''
from scipy.special._ufuncs import it2j0y0
n1 = 3
print type(n1) #数据类型函数<type 'int'>

x=True
print int(x)   #强制类型转换 1
y=3.2
print int(y)   #强制类型转换 3

z=3+2j
print z        #复数类型 (3+2j)

print z.real   #返回实部
print z.imag   #返回虚部

print z.conjugate() #返回共轭复数 3-2j


x=(3,4)
print x    #元祖不能修改,使用圆括号
y=[3,4,5]
print y    #列表
dic={"a":1,"b":2}
print dic  #键是字符串        字典

猜你喜欢

转载自blog.csdn.net/qingliangdexiar/article/details/82533689