跳转到内容
View in the app

A better way to browse. Learn more.

彼岸论坛

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
欢迎抵达彼岸 彼岸花开 此处谁在 -彼岸论坛

[程序员] 为什么有一些 Python 入门书不教 class, yield, self 之类的方法?

发表于
我是个编程纯小白,在自学 Python 。选的入门书是《 Python 编程快速上手——让繁琐工作自动化》。这本书在众多的 Python 自学建议里都被提及,豆瓣评分也不错。但我发现,看不少视频教程,或者其他人的代码里,经常看到 class ,yield ,self ,__init__之类的方法(我也不知道该管他们叫什么,暂且统称方法吧),但是在《 Python 编程快速上手——让繁琐工作自动化》里似乎完全没有提及。我大致看了一下这几个方法的教程和视频,发现确实看不懂。我有几个问题:

1 、请问为什么这么受好评的入门书里面不教这几个方法?

2 、如果我不学这几个方法,未来会遇到什么问题?是否只是代码会写得繁琐一点,但还是能绕过去?(我学 Python 不是为了就业当程序员,只是为了提高工作效率)

3 、可否用踢足球或者开汽车来类比一下这些方法?是否这些方法是类似于倒钩射门或者甩尾漂移?普通人一辈子都不会用到,不学无妨?还是说相当于 40 米远射?我射不了那么远,但可以麻烦一点多传几脚到禁区内再射门?

请大神们指点迷津。

Featured Replies

No posts to show

创建帐户或登录来提出意见

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.