
学习
focus_reality
学习一门编程语言,将结构设计仿真与语言结合起来
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
命令行中运行编辑好的python代码
命令行中运行编辑好的python代码完整目录相对目录 完整目录 相对目录原创 2019-03-31 19:57:50 · 532 阅读 · 0 评论 -
Performing HTTP requests in Python using urllib
Performing HTTP requests in Python using urllib # Import packages from urllib.request import urlopen, Request # Specify the url url = "http://www.datacamp.com/teach/documentation" # This packages th...转载 2019-05-27 22:16:23 · 184 阅读 · 0 评论 -
读取csv文件转换为列表序列
from csv import reader potus = list(reader(open(‘potus_visitors_2015.csv’)))原创 2019-05-17 21:51:09 · 4562 阅读 · 2 评论 -
Class
An object is an entity that stores data. An object’s class defines specific properties objects of that class will have.转载 2019-05-16 22:07:52 · 137 阅读 · 0 评论 -
apply formatting to numbers using str.format()
转载 2019-05-16 21:11:14 · 274 阅读 · 0 评论 -
str.format() method
字符串输出 name = "Kylie" num = 8 output = name + "'s favorite number is " + str(num) print(output) Kylie’s favorite number is 8 str.format() method 输出 1. The variables are inserted into the {} by the or...转载 2019-05-16 20:45:17 · 245 阅读 · 0 评论 -
frequence table
fruit = ['orange', 'orange', 'orange', 'banana', 'apple', 'banana', 'orange', 'banana', 'apple', 'banana'] fruit_frequency = {} for f in fruit: if f not in fruit_freque...转载 2019-05-16 20:31:08 · 217 阅读 · 0 评论 -
advanve comprehesions
list comprehensions # Create a 5 x 5 matrix using a list of lists: matrix matrix = [[col for col in range(5)] for row in range(5)] # Print the matrix for row in matrix: print(row) [0, 1, 2, 3, ...翻译 2019-05-24 22:10:54 · 187 阅读 · 0 评论 -
enumerate and zip
enumerate() returns an enumerate object that produces a sequence of tuples, and each of the tuples is an index-value pair. # Create a list of strings: mutants mutants = ['charles xavier', ...转载 2019-05-24 21:31:03 · 360 阅读 · 0 评论 -
Count the number of Duplicates
Count the number of Duplicates Write a function that will return the count of distinct case-insensitive alphabetic characters and numeric digits that occur more than once in the input string. The inpu...转载 2019-04-26 22:50:56 · 374 阅读 · 0 评论 -
查看python内置范围
import builtins dir(builtins)原创 2019-05-23 20:00:19 · 171 阅读 · 0 评论