1.Numeric type

(1)integer

Use

Is to show people's age;phone number ;id numbers etc.

Define

age_Nick=18 #nick is eighteen years old
print(id(age_Nick))#140733086069536
print(type(age_Nick#<class 'int'>
print(age_Nick)#18

How to use

plus minus,multiply,divide or some logical comparison > <

(2)float

Usefulness

Is to show height weight salary etc.

Define

salary = 2.1  # salary=float(2.1)

print(id(salary))#2188554482512
print(type(salary))#<class 'float'>
print(salary)#2.1

How to use

The same to int plus minus,multiply,divide or some logical comparison > <

2.string type

Use

To show the name ,hobby etc.

Define

name1 = 'Nick'
name2 = "Egg"
print(id(name1))#2039780276080
print(type(name1))#<class 'str'>
print(name1)#Nick
name3 = """Nick
Egg""" print(name3)#Nick
#Egg

How to use

string type can only plus multiply or logical comparison

3.list

Use

To store multiple value such as multiple girlfriend multiple hobbies .

Define

hobby = 'read'
hobby_list = [hobby, 'run', 'girl']
print(id(hobby_list))#3013323084360
print(type(hobby_list))#<class 'list'>
print(hobby_list)#['read', 'run', 'girl']

How to use

Our aim is not to store but to take I'll show the way to take value from list and plz remenber the start number is 0

4.Dictionary

Use

Is to store many many value from

key value

way ,and while taking can follow the key,key can describe value.

Define

user_info = {'name': 'nick', 'gender': 'male', 'age': 19,
'company_info': ['oldboy', 'shanghai', 50]} print(id(user_info))#1738629399160
print(type(user_info))#<class 'dict'>
print(user_info)#{'name': 'nick', 'gender': 'male', 'age': 19, 'company_info': ['oldboy', 'shanghai', 50]}

How to use

dictionary taking value is no more rely on indexes,but rely on the key ,though the [key],can get key's value.

4.Wordcloud

import jieba
import wordcloud
# import module from imageio import imread
mk=imread('wujo.png') s="蔡徐坤 把 唱 跳 手起刀落 rap 篮球 打成筛子 流量明星 口红 男扮女装 鸡你太美 随后 获得 出道后 首个 个人 音乐类 奖项 亚洲新歌榜 2018 年度盛典“ 最受欢迎 潜力 男歌手"
s_list=jieba.lcut(s)
print(s_list)
s=''.join(s_list) w=wordcloud.WordCloud(font_path='C:\Windows\Fonts\simsun.ttc',mask=mk,background_color='white')
w.generate(s)
w.to_file('cxk1.png')

最新文章

  1. MySQL 博客文章目录(2016-08-20更新)
  2. poj 3630 Phone List
  3. java强制类型转换
  4. PHP那些非常有用却鲜有人知的函数
  5. 提高Linux安全性--hosts.allow, hosts.deny 文件修改方法
  6. Hadoop插件安装
  7. AsyncTask測试多任务
  8. C++STL之双端队列容器
  9. JDK1.8源码(四)——java.util.Arrays 类
  10. Python/Django-Web原理(一)
  11. Java 重入锁 ReentrantLock 原理分析
  12. SimpleDateFormat 线程不安全及解决方案
  13. python判断文件是否存在
  14. html+css+js整体布局——[防止浏览器扩大,界面排版混乱]
  15. ubuntu创建新用户
  16. git学习心得
  17. js 提示条
  18. java虚拟机的内存划分
  19. Hadoop生态圈-Flume的主流source源配置
  20. PrefixSpan

热门文章

  1. 2019牛客多校第⑨场H Cutting Bamboos(主席树+二分)
  2. nginx -stream(tcp连接)反向代理配置 实现代理mysql以及文件上传
  3. python学习笔记:网络请求——urllib模块
  4. list列表操作(创建、增加、删除、取值)
  5. layer通过父页面调用子页面的方法及属性
  6. 【目录】Asp.NETCore轻松学系列
  7. 初探Remoting双向通信(二)
  8. texinfo - 软件文档系统
  9. Eclipse中发布Maven管理的Web项目时找不到类的问题根源和解决办法(转)
  10. JavaWeb开发之二《JSP&#160;+&#160;Tomcat的第一个程序“Hello&#160;World”》