René's URL Explorer Experiment


Title: Python中的几种集合 · Issue #3 · makisang/learn-python · GitHub

Open Graph Title: Python中的几种集合 · Issue #3 · makisang/learn-python

X Title: Python中的几种集合 · Issue #3 · makisang/learn-python

Description: list 列表是一种有序的数据集合,可以随时添加和删除其中的元素 >>> classmates = ['Michael', 'Bob', 'Tracy'] >>> classmates ['Michael', 'Bob', 'Tracy'] 添加元素通过append或者insert,删除元素通过pop >>> classmates.append('Adam') >>> classmates.insert(1, 'Jack') >>> classmates.pop() '...

Open Graph Description: list 列表是一种有序的数据集合,可以随时添加和删除其中的元素 >>> classmates = ['Michael', 'Bob', 'Tracy'] >>> classmates ['Michael', 'Bob', 'Tracy'] 添加元素通过append或者insert,删除元素通过pop >>> classmates.append('Adam') >>> classmates....

X Description: list 列表是一种有序的数据集合,可以随时添加和删除其中的元素 >>> classmates = ['Michael', 'Bob', 'Tracy'] >>> classmates ['Michael', 'Bob', 'Tracy'] 添加元素通过appe...

Opengraph URL: https://github.com/makisang/learn-python/issues/3

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Python中的几种集合","articleBody":"## list\n\n列表是一种有序的数据集合,可以随时添加和删除其中的元素\n\n```\n\u003e\u003e\u003e classmates = ['Michael', 'Bob', 'Tracy']\n\u003e\u003e\u003e classmates\n['Michael', 'Bob', 'Tracy']\n```\n\n添加元素通过`append`或者`insert`,删除元素通过`pop`\n\n```\n\u003e\u003e\u003e classmates.append('Adam')\n\u003e\u003e\u003e classmates.insert(1, 'Jack')\n\u003e\u003e\u003e classmates.pop()\n'Adam'\n\u003e\u003e\u003e classmates.pop(1)\n'Jack'\n```\n## tuple\n\n元组和列表类似,但是一旦初始化就不能修改\n\n```\n\u003e\u003e\u003e t = (1, 2)\n\u003e\u003e\u003e t\n(1, 2)\n```\n\n注意,当定义的元组只有一个元素时,要加一个逗号\n\n```\n\u003e\u003e\u003e t = (1, )\n\u003e\u003e\u003e t\n(1, )\n```\n## dict\n\ndict和java中的map类似,使用键-值(key-value)存储,具有很快的存储速度,但是内存占用大,是一种空间换时间的做法\n\n```\n\u003e\u003e\u003e d = {'Michael': 95, 'Bob': 75, 'Tracy': 85}\n\u003e\u003e\u003e d['Michael']\n95\n\u003e\u003e\u003e d.get('Michael')\n95\n```\n\ndict可以用在许多需要快速查找的地方,需要牢记一点:dict的key必须是**不可变对象**\n## set\n\nset和dict类似,也是一组key的集合,但是set不能存储value,同样的,set中没有重复的key\n要创建一个set,需要提供一个列表作为输入,重复元素自动被忽略\n\n```\n\u003e\u003e\u003e s = set([1, 1, 2, 2, 3, 3])\n\u003e\u003e\u003e s\n{1, 2, 3}\n```\n\nset可以看成数学意义上的无序和无重复元素的集合,因此,两个set可以做数学意义上的交集、并集等操作\n\n```\n\u003e\u003e\u003e s1 = set([1, 2, 3])\n\u003e\u003e\u003e s2 = set([2, 3, 4])\n\u003e\u003e\u003e s1 \u0026 s2\n{2, 3}\n\u003e\u003e\u003e s1 | s2\n{1, 2, 3, 4}\n```\n","author":{"url":"https://github.com/makisang","@type":"Person","name":"makisang"},"datePublished":"2016-10-16T12:12:31.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/3/learn-python/issues/3"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:21489fb2-11a7-78a2-bc1c-4b606cc036cc
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id81B0:3BDF7:19F5143:2153E03:697FB70E
html-safe-noncea09c8cdff5f1e52deb427f2771f880e6972e9d36d97b6a3ac77fe015d08b824b
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MUIwOjNCREY3OjE5RjUxNDM6MjE1M0UwMzo2OTdGQjcwRSIsInZpc2l0b3JfaWQiOiI0NzI4NTU4NTcwMDE3MTA5Nzc0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmaced7826853fda4ea9fcca8d9f202d3f69e75b0ebe378fa7679e7ee17045d30dbe
hovercard-subject-tagissue:183263910
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/makisang/learn-python/3/issue_layout
twitter:imagehttps://opengraph.githubassets.com/7971e31bc6a7e8c8a86c8adb78a9ff2f5603b4187442d7bcc7e0f3d001c2ce7e/makisang/learn-python/issues/3
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/7971e31bc6a7e8c8a86c8adb78a9ff2f5603b4187442d7bcc7e0f3d001c2ce7e/makisang/learn-python/issues/3
og:image:altlist 列表是一种有序的数据集合,可以随时添加和删除其中的元素 >>> classmates = ['Michael', 'Bob', 'Tracy'] >>> classmates ['Michael', 'Bob', 'Tracy'] 添加元素通过append或者insert,删除元素通过pop >>> classmates.append('Adam') >>> classmates....
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamemakisang
hostnamegithub.com
expected-hostnamegithub.com
None60279d4097367e16897439d16d6bbe4180663db828c666eeed2656988ffe59f6
turbo-cache-controlno-preview
go-importgithub.com/makisang/learn-python git https://github.com/makisang/learn-python.git
octolytics-dimension-user_id16376280
octolytics-dimension-user_loginmakisang
octolytics-dimension-repository_id63069875
octolytics-dimension-repository_nwomakisang/learn-python
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id63069875
octolytics-dimension-repository_network_root_nwomakisang/learn-python
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release7c85641c598ad130c74f7bcc27f58575cac69551
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/makisang/learn-python/issues/3#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmakisang%2Flearn-python%2Fissues%2F3
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmakisang%2Flearn-python%2Fissues%2F3
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=makisang%2Flearn-python
Reloadhttps://patch-diff.githubusercontent.com/makisang/learn-python/issues/3
Reloadhttps://patch-diff.githubusercontent.com/makisang/learn-python/issues/3
Reloadhttps://patch-diff.githubusercontent.com/makisang/learn-python/issues/3
makisang https://patch-diff.githubusercontent.com/makisang
learn-pythonhttps://patch-diff.githubusercontent.com/makisang/learn-python
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2Fmakisang%2Flearn-python
Fork 0 https://patch-diff.githubusercontent.com/login?return_to=%2Fmakisang%2Flearn-python
Star 0 https://patch-diff.githubusercontent.com/login?return_to=%2Fmakisang%2Flearn-python
Code https://patch-diff.githubusercontent.com/makisang/learn-python
Issues 14 https://patch-diff.githubusercontent.com/makisang/learn-python/issues
Pull requests 0 https://patch-diff.githubusercontent.com/makisang/learn-python/pulls
Actions https://patch-diff.githubusercontent.com/makisang/learn-python/actions
Projects 0 https://patch-diff.githubusercontent.com/makisang/learn-python/projects
Security 0 https://patch-diff.githubusercontent.com/makisang/learn-python/security
Insights https://patch-diff.githubusercontent.com/makisang/learn-python/pulse
Code https://patch-diff.githubusercontent.com/makisang/learn-python
Issues https://patch-diff.githubusercontent.com/makisang/learn-python/issues
Pull requests https://patch-diff.githubusercontent.com/makisang/learn-python/pulls
Actions https://patch-diff.githubusercontent.com/makisang/learn-python/actions
Projects https://patch-diff.githubusercontent.com/makisang/learn-python/projects
Security https://patch-diff.githubusercontent.com/makisang/learn-python/security
Insights https://patch-diff.githubusercontent.com/makisang/learn-python/pulse
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/makisang/learn-python/issues/3
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/makisang/learn-python/issues/3
Python中的几种集合https://patch-diff.githubusercontent.com/makisang/learn-python/issues/3#top
https://github.com/makisang
https://github.com/makisang
makisanghttps://github.com/makisang
on Oct 16, 2016https://github.com/makisang/learn-python/issues/3#issue-183263910
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.