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')

assignment of day four的更多相关文章

  1. Atitit GRASP(General Responsibility Assignment Software Patterns),中文名称为“通用职责分配软件模式”

    Atitit GRASP(General Responsibility Assignment Software Patterns),中文名称为"通用职责分配软件模式" 1. GRA ...

  2. user initialization list vs constructor assignment

    [本文连接] http://www.cnblogs.com/hellogiser/p/user_initialization_list.html [分析] 初始化列表和构造函数内的赋值语句有何区别? ...

  3. Swift 提示:Initialization of variable was never used consider replacing with assignment to _ or removing it

    Swift 提示:Initialization of variable was never used consider replacing with assignment to _ or removi ...

  4. 代写assignment

    集英服务社,强于形,慧于心 集英服务社,是一家致力于优质学业设计的服务机构,为大家提供优质原创的学业解决方案.多年来,为海内外学子提供了多份原创优质的学业设计解决方案. 集英服务社,代写essay/a ...

  5. [Top-Down Approach] Assignment 1: WebServer [Python]

    Today I complete Socket Programming Assignment 1 Web Server Here is the code: #!/usr/bin/python2.7 # ...

  6. default constructor,copy constructor,copy assignment

     C++ Code  12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 ...

  7. Programming Assignment 5: Kd-Trees

    用2d-tree数据结构实现在2维矩形区域内的高效的range search 和 nearest neighbor search.2d-tree有许多的应用,在天体分类.计算机动画.神经网络加速.数据 ...

  8. Programming Assignment 4: 8 Puzzle

    The Problem. 求解8数码问题.用最少的移动次数能使8数码还原. Best-first search.使用A*算法来解决,我们定义一个Seach Node,它是当前搜索局面的一种状态,记录了 ...

  9. Programming Assignment 2: Randomized Queues and Deques

    实现一个泛型的双端队列和随机化队列,用数组和链表的方式实现基本数据结构,主要介绍了泛型和迭代器. Dequeue. 实现一个双端队列,它是栈和队列的升级版,支持首尾两端的插入和删除.Deque的API ...

  10. 逆转序列的递归/尾递归(+destructuring assignment)实现(JavaScript + ES6)

    这里是用 JavaScript 做的逆转序列(数组/字符串)的递归/尾递归实现.另外还尝鲜用了一下 ES6 的destructuring assignment + spread operator 做了 ...

随机推荐

  1. Spingboot整合Redis,用注解(@Cacheable、@CacheEvict、@CachePut、@Caching)管理缓存

    背景:项目从头开始,需结合Springboot和Redis 需求:用注解管理缓存 方法:     一.用Redis取代Springboot原有缓存 1.pom引入依赖     2.applicatio ...

  2. Java对象引用四个级别(强、软、弱、虚)

    最近,高级Java技术栈微信群中,有一些猿友在讨论JVM中对象的周期问题,有谈到引用的级别,现在为大家做个总结吧,虽然大多数公司并没有意识或者用到这些引用,但了解这些基本概念对熟悉整个垃圾回收机制和面 ...

  3. 35-python基础-python3-字符串修改大小写的方法-title()方法-lower()方法-upper()方法

    1-title()-注:不是原地修改,有返回值 以首字母大写的方式显示每个单词,即将每个单词的首字母都改为大写. 2-lower()和upper()-注:不是原地修改,有返回值 将字符串改为全部小写或 ...

  4. CTU OPEN 2017 Ice cream samples /// 尺取法

    题目大意: 给定n k 接下来n行 给定n个摊位的冰淇淋信息 首先给一个t 表示这个摊位有t个冰淇淋 接下来t个数表示对应冰淇淋的品种 走到连续的几个摊位 会买下走过的摊位的所有的冰淇淋 求 要买下所 ...

  5. linux下又一次定位svn url方法

    版权声明:本文为博主原创文章.未经博主同意不得转载. https://blog.csdn.net/oudahe/article/details/34437661 linux下又一次定位svn url方 ...

  6. mySQL学习入门教程——2.创建表

    二.创建表 一.创建数据表的SQL语句模型(弱类型)CREATE TABLE [IF NOT EXISTS] 表名称(字段名1 列的类型[属性][索引],字段名2 列的类型[属性][索引],-字段名n ...

  7. Git中crlf自动转换的坑

    新上手一个项目,克隆了代码下来搭环境,一路坑.其中一个sh脚本执行不了,报IOException,java日志除了"找不到文件或文件夹"之外看不出任何信息,手动运行脚本才发现是脚本 ...

  8. todolist拆分为逻辑页面和ui页面

    我们可以把Todolist 继续拆分 ,拆分为逻辑页面和ui页面 ui 页面 import React, { Component } from 'react';import 'antd/dist/an ...

  9. idea激活教程,最新!!!

    1.下载破解补丁(关键). 破解补丁:JetbrainsIdesCrack-4.2-release.jar百度云地址:https://pan.baidu.com/s/18ovphd7sm7oYXQb4 ...

  10. php重定向说明

    302  临时重定向 header("location:http://api.com/headline?" . http_build_query($_REQUEST)); 301  ...