{{sellerTotalView > 1 ? __("sellers", {number: sellerTotalView}) : __("seller", {number: sellerTotalView}) }}, {{numTotalView > 1 ? __("items", {number: numTotalView}) : __("item", {number: numTotalView}) }}
free FREE

Change Your Zip Code

Inventory information and delivery speeds may vary for different locations.

Location History

{{email ? __('Got it!') : __('Restock Alert')}}

We will notify you by email when the item back in stock.

Cancel
Yami

Jingdong book

父与子的编程之旅:与小卡特一起学Python

{{buttonTypePin == 3 ? __("Scan to view more PinGo") : __("Scan to start")}}

父与子的编程之旅:与小卡特一起学Python

{{__(":people-members", {'people': item.limit_people_count})}} {{ itemCurrency }}{{ item.valid_price }} {{ itemCurrency }}{{ item.invalid_price }} {{ itemDiscount }}
Ends in
{{ itemCurrency }}{{ item.valid_price }}
{{ itemCurrency }}{{ priceFormat(item.valid_price / item.bundle_specification) }}/{{ item.unit }}
{{ itemDiscount }}
{{ itemCurrency }}{{ item.valid_price }} {{ itemCurrency }}{{ priceFormat(item.valid_price / item.bundle_specification) }}/{{ item.unit }} {{ itemCurrency }}{{ item.invalid_price }} {{itemDiscount}}
{{ itemCurrency }}{{ item.valid_price }}
Sale ends in
Sale will starts after Sale ends in
{{ getSeckillDesc(item.seckill_data) }}
{{ __( "Pay with Gift Card to get sale price: :itemCurrency:price", { 'itemCurrency' : itemCurrency, 'price' : (item.giftcard_price ? priceFormat(item.giftcard_price) : '0.00') } ) }} ({{ itemCurrency }}{{ priceFormat(item.giftcard_price / item.bundle_specification) }}/{{ item.unit }}) Details
Best before

Currently unavailable.

We don't know when or if this item will be back in stock.

Unavailable in your area.
Sold Out

Details

Full product details
Editer Recommend

本书上一版荣获Jolt生产效率大奖。
除本书外,市面上没有其他教孩子编程的相关图书。
麻省理工学院公益计划“每个孩子一台笔记本”发起人尼古拉斯·尼葛洛庞蒂倾力推荐。
Content Description

《父与子的编程之旅:与小卡特一起学Python》是一本家长与孩子共同学习编程的入门书。作者是一对父子,他们以Python语言为例,详尽细致地介绍了Python如何安装、字符串和操作符等程序设计的基本概念,介绍了条件语句、函数、模块等进阶内容,讲解了用Python实现游戏编程。书中的语言生动活泼,叙述简单明了。为了让学习者觉得编程有趣,《父与子的编程之旅:与小卡特一起学Python》编排了很多卡通人物及场景对话,让学习者在轻松愉快之中跨入计算机编程的大门。
《父与子的编程之旅:与小卡特一起学Python》适合中小学生以及一切编程初学者。
Author Description

Warren Sande,毕业于加拿大里贾那大学电气工程系。一直在面向计算机初学者教授软件基础课程,编写过大量广受欢迎的技术文档。
Carter Sande,Warren之子,高中生,热爱计算机技术,自幼就跟着父亲玩编程,喜欢骑自行车和编写复古的电子游戏。
Comments

★上到88岁,下到8岁,都可以阅读本书。它不仅以一种有趣的方式介绍了Python编程的知识,其中的实践还适用于其他编程语言的学习。
——Ben Ooms,Sogeti公司软件工程师

★不论老幼,只要想学习编程这门有趣的技能,这都是一本非常好的介绍性书籍。
——Sue Gee,www.i-programmer.info网站

★Warren和Carter由简入难,直到教会读者制作有趣的2D图形游戏和模拟器。Python是我向刚入门的程序员推荐的语言,而本书恰是非常好的学习资源。第1版出版后我就一直向学生们推荐这本书。
——Dave Briccetti,Dave Briccetti Software LLC公司软件开发者和教师
Catalogue

第1章出发吧1
1.1安装Python1
1.2从IDLE启动Python3
1.3来点指令吧4
1.4与Python交互6
1.5该编程了7
1.6运行你的第一个程序9
1.7如果出问题10
1.8你的第二个程序12

第2章记住内存和变量15
2.1输入、处理和输出15
2.2名字17
2.3名字里是什么21
2.4数字和字符串22
2.5它们有多“可变”23
2.6全新的我24

第3章基本数学运算27
3.1四大基本运算27
3.2操作符29
3.3运算顺序30
3.4另外两个操作符32
3.5非常大和非常小34

第4章数据的类型39
4.1改变类型39
4.2得到更多信息:type()42
4.3类型转换错误43
4.4使用类型转换43

第5章输入45
5.1raw_input()45
5.2print命令和逗号46
5.3输入数字48
5.4来自互联网的输入50

第6章GUI——图形用户界面54
6.1什么是GUI54
6.2第一个GUI55
6.3GUI输入56
6.4选择你的口味57
6.5再看猜数游戏……60
6.6其他GUI组件61

第7章判断再判断64
7.1测试,测试64
7.2缩进66
7.3是不是有问题67
7.4其他类型的测试68
7.5如果测试为假会怎么样69
7.6测试多个条件71
7.7使用and72
7.8使用or73
7.9使用not73

第8章转圈圈77
8.1计数循环78
8.2使用计数循环80
8.3一条捷径——range()81
8.4风格问题——循环变量名83
8.5按步长计数85
8.6没有数字的计数87
8.7关于这个问题……88
8.8跳出循环——break和continue89

第9章全都为了你——注释93
9.1增加注释93
9.2单行注释94
9.3行末注释94
9.4多行注释94
9.5注释风格95
9.6注释掉96

第10章游戏时间到了98

第11章嵌套与可变循环103
11.1嵌套循环103
11.2可变循环105
11.3可变嵌套循环106
11.4更多可变嵌套循环107
11.5使用嵌套循环109

第12章收集起来——列表与字典116
12.1什么是列表116
12.2创建列表117
12.3向列表增加元素117
12.4这个点是什么118
12.5列表可以包含任何内容118
12.6从列表获取元素119
12.7列表“分片”120
12.8修改元素122
12.9向列表增加元素的其他方法122
12.10从列表删除元素124
12.11搜索列表125
12.12循环处理列表126
12.13列表排序127
12.14可改变和不可改变130
12.15双重列表:数据表130
12.16字典133

第13章函数140
13.1函数——积木140
13.2调用函数142
13.3向函数传递参数143
13.4有多个参数的函数146
13.5返回值的函数148
13.6变量作用域149
13.7强制为全局152
13.8关于变量命名的一点建议153

第14章对象155
14.1真实世界中的对象155
14.2Python中的对象156
14.3对象=属性+方法157
14.4这个点是什么157
14.5创建对象158
14.6一个示例类——HotDog163
14.7隐藏数据168
14.8多态和继承168
14.9未雨绸缪170

第15章模块173
15.1什么是模块173
15.2为什么使用模块173
15.3积木桶174
15.4如何创建模块174
15.5如何使用模块174
15.6命名空间176
15.7标准模块179

第16章图形183
16.1寻求帮助——Pygame183
16.2Pygame窗口183
16.3在窗口中画图185
16.4单个像素194
16.5图像198
16.6动起来200
16.7动画201
16.8更流畅的动画202
16.9让球反弹203
16.10让球翻转206

第17章动画精灵和碰撞检测209
17.1动画精灵209
17.2嘣!碰撞检测215
17.3统计时间219

第18章一种新的输入——事件224
18.1事件224
18.2键盘事件226
18.3鼠标事件230
18.4定时器事件232
18.5另一个游戏——PyPong234

第19章声音246
19.1从Pygame寻求更多帮助——mixer246
19.2制造声音与播放声音247
19.3播放声音247
19.4控制音量250
19.5重复音乐252
19.6为PyPong添加声音252
19.7更多声音253
19.8为PyPong添加音乐257

第20章更多GUI261
20.1使用PyQt261
20.2让GUI做点事情266
20.3事件处理器的返回268
20.4移动按钮269
20.5更多有用的GUI269
20.6TempGUI269
20.7菜单上是什么275

第21章打印格式化与字符串281
21.1换行282
21.2水平间隔——制表符283
21.3在字符串中插入变量285
21.4数字格式化286
21.5格式化的新方法291
21.6更多字符串处理292

第22章文件输入与输出299
22.1什么是文件299
22.2文件名300
22.3文件位置301
22.4打开文件304
22.5读文件305
22.6文本文件和二进制文件307
22.7写文件309
22.8在文件中保存内容:pickle312
22.9又到了游戏时间——Hangman314

第23章碰运气——随机性322
23.1什么是随机性322
23.2掷骰子323
23.3创建一副牌328
23.4Crazy Eights332

第24章计算机仿真345
24.1真实世界建模345
24.2Lunar Lander346
24.3跟踪时间351
24.4时间对象352
24.5把时间保存到文件355
24.6电子宠物357

第25章Skier游戏的说明368
25.1滑雪者368
25.2障碍物372

第26章Python Battle381
26.1Python Battle381
26.2创建一个Python Battle机器人383
26.3更复杂的机器人385
26.4坐标系统385

第27章接下来呢390
27.1致年龄小的读者390
27.2Python391
27.3游戏编程与Pygame391
27.4其他语言的游戏编程(非Python)391
27.5传承BASIC392
27.6移动应用392
27.7回顾392

附录A变量命名规则394
附录BPython 2与Python 3的差异396
附录C自测题答案399

Introduction

前言是什么?前言就是一本书开头的那一部分,这部分没多大意思,可以把前言跳过去直接读后面具体的内容。你是不是这么想的?确实,如果你真想这么干, 当然可以跳过这个前言(喂,你是不是现在就打算翻页了?),不过天晓得你会漏掉什么好东西……反正篇幅也不长,也许你应该看看再说,没准真会有意想不到的收获。
什么是编程
很简单,编程(programming)就是告诉计算机要做什么。计算机只是一些没有生命的机器,它们自己可不知道该做什么,一切都得你来告诉它,而且你还必须把细节都说清楚。
术语箱
指令(instruction)就是下达给计算机的一个基本命令,通常要求计算机做某件特定的事情。
计算机程序是由多个指令组成的。为什么计算机能做到这么多了不起的事情呢?这是因为有许多聪明的程序员编写了程序或者软件(software)来告诉它们该怎样做。软件就是你的计算机上运行的程序,有时软件也可能运行在与你的计算机相连的另一台计算机上,比如Web 服务器。
到底怎么回事?
计算机要用非常非常多的电路来“思考”。在最底层,这些电路是一些开关。
工程师和计算机科学家们使用1 和0 来代表“开”和“关”。所有这些1 和0 是一种二进制(binary)的编码。二进制实际上就表示“两种状态”。这两种状态分别是“开”和“关”,也就是1 和0。
你知道吗? 二进制位 = 比特(bit)
Python—我们和计算机沟通的语言
所有计算机在内部都使用二进制。不过大多数人都不擅长使用这种语言。我们需要一种更简便的方法来告诉计算机要做什么。所以人们发明了编程语言。利用计算机编程语言,我们可以先用一种自己能理解的方式写程序,然后再把它翻译成二进制供计算机使用。
有很多不同的编程语言。本书会教你如何使用其中的一种语言(Python)来告诉计算机要做什么。
为什么学编程
你可能不会成为一名专业的程序员(大多数人都不会),不过学习编程确实有很多理由。
最重要的原因是你想学 !不论是作为业余爱好还是作为职业,编程都会很有意思,都会让你很有收获。
如果你对计算机感兴趣,想更多地了解它到底怎么工作,想知道怎样才能让它做你想做的事情,这也不失为学习编程的一个好理由。
也许你想编写自己的游戏,或者找不到合适的程序能完全满足你的需要,如果是这样,你就会想自己编写程序。
如今计算机已经无处不在,工作中、学校里或者在家里很有可能使用计算机(可能这三种场合都少不了计算机)。学习编程能帮助你从总体上更好地了解计算机。
为什么选用Python 语言
既然有各种各样的编程语言可以选择(确实太多了 !),对于这样一本给孩子们看的编程书,我为什么要选择Python 呢?主要有以下几个原因。
最初创建Python 语言的出发点就是为了便于学习。在我所见过的所有计算机?语言中,Python 程序是最易读、最容易编写,也是最容易理解的。
Python 是免费的。你可以下载Python,还可以下载很多很多用Python 编写的既好玩又有用的程序,所有这些都是免费的。
Python 是开源(open source)软件。从某个角度来讲,“开源”的含义是指任?何用户都可以扩展(extend)Python,也就是创建一些新“工具”。补充这些新工具后,就可以用Python 做更多的事情,或者尽管是做同样的事情,但是有了这些新工具后会比原先更容易。很多人已经做了这种扩展,目前已经有非常多的免费Python 工具可以供你下载。
Python 并不是一个“玩具”。确实,它非常适合学习编程,不过实际上全世?界每天都有成千上万的专业人士在使用这种语言,甚至包括类似NASA(美国航空航天局)和Google 这些机构的程序员。所以,学习Python 后,你不用转换语言再去学一种“真正的”语言来编写“真正的”程序;很多工作都完全可以使用Python 完成。
Python 可以在各种不同类型的计算机上运行。Windows 电脑、苹果电脑和运?行Linux 的计算机上都可以使用Python。大多数情况下,如果一个Python 程序可以在你家里的Windows 电脑上运行,那么这个程序同样也可以在你学校的苹果电脑上运行。本书适用于几乎所有安装了Python 的计算机。(另外要记住,如果你要用的计算机上还没有安装Python,完全可以免费安装。)
我自己很钟爱Python,非常喜欢学习和使用这种语言,我想你也会和我一?样。
像程序员一样思考
这本书会使用Python 语言,不过你在这里学到的有关编程的大多数内容也适用于所有计算机语言。学习用Python 编程可以让你有一个很好的起点,有了这个基础,将来学习任何其他语言都会很轻松。
有趣的内容
还有一点需要指出……
使用计算机最有趣的就是玩游戏,游戏中的图像和音效对小孩子尤其有吸引力。我们将要学习如何编写自己的游戏,在这个过程中还会利用图形和声音做很多工作。下面就是我们将要开发的一些程序的屏幕截图。
不过,我认为(或者说我希望),就像让飞船和滑雪的角色在屏幕上移动一样, 你会发现学习这些基础知识并着手编写第一个程序同样很有趣。
祝你玩得开心!

Specifications

Brand Jingdong book
Brand Origin China

Disclaimer

Product packaging, specifications and price are subject to change without notice. All information about the products on our website is provided for information purposes only. Please always read labels, warnings and directions provided with the product before use.

View Full Terms of Use
Add to favorites
{{ $isZh ? coupon.coupon_name_sub : coupon.coupon_ename_sub | formatCurrency }}
{{__("Buy Directly")}} {{ itemCurrency }}{{ item.directly_price }}
Quantity
{{ quantity }}
{{ instockMsg }}
{{ limitText }}
{{buttonTypePin == 3 ? __("Scan to view more PinGo") : __("Scan to start")}}
Sold by JD@CHINA
Ship to
{{ __("Ship to United States only") }}
Free shipping over 69
Genuine guarantee

Added to Cart

Keep Shopping

More to Consider

{{ item.brand_name }}

{{ item.item_name }}

{{ item.currency }}{{ item.market_price }}

{{ item.currency }}{{ item.unit_price }}

{{ item.currency }}{{ item.unit_price }}

Coupons

{{ coupon.coupon_name_new | formatCurrency }}
Clip Clipped Over
{{ getCouponDescStr(coupon) }}
{{ coupon.use_time_desc }}
Expires soon {{ formatTime(coupon.use_end_time) }}

Share this item with friends

Cancel

Yami Gift Card

Get this exclusive deal when paying with gift card

Terms and Conditions

Gift card deals are special offers for selected products;

The gift card deals will automatically be activated if a customer uses gift card balance at check out and the balance is sufficient to pay for the total price of the shopping cart products with gift card deals;

You will not be able to activate the gift card deals if you choose other payment methods besides gift card. The products will be purchased at their normal prices;

If your account balance is not enough to pay for the products with gift card deals, you can choose to reload your gift card balance by clicking on the Reload button at either shopping cart page or check out page;

Products that have gift card deals can be recognized by a special symbol showing 'GC Deal';

For any additional questions or concerns, please contact our customer service;

Yamibuy reserves the right of final interpretation.

Sold by Yami

Service Guarantee

Yami Free Shipping over $49
Yami Easy Returns
Yami Ships from United States

Shipping

  • United States

    Standard Shipping is $5.99 (Excluding Alaska & Hawaii). Free on orders of $49 or more.

    Local Express is $5.99 (Available in Parts of CA, NJ, MA & PA). Free on orders of $49 or more.

    2-Day Express (Includes Alaska & Hawaii) starts at $19.99.

Return Policy

Yami is committed to provide our customers with a peace of mind when purchasing from us. Most items shipped from Yamibuy.com can be returned within 30 days of receipt of shipment (For Food, Beverages, Snacks, Dry Goods, Health supplements, Fresh Grocery and Perishables Goods, within 7 days of receipt of shipment due to damages or quality issues; To ensure that every customer receives safe and high-quality products, we do not provide refunds or returns for beauty products once they have been opened or used, except in the case of quality issues; Some products may have different policies or requirements associated with them, please see below for products under special categories, or contact Yami Customer Service for further assistance).
Thank you for your understanding and support.

Learn More

Sold by Yami

Terms and Conditions of Yami E-Gift Card

If you choose “Redeem automatically” as your delivery method, your gift card balance will be reload automatically after your order has been processed successfully;

If you choose “Send to Email”as your delivery method, the card number and CVV will be sent to the email address automatically;

Any user can use the card number and CVV to redeem the gift card, please keep your gift card information safely. If you have any trouble receiving email, please contact Yami customer service;

Yami gift card can be used to purchase both Yami owned or Marketplace products;

Yami gift card will never expire;

Yami gift card balance does not have to be used up at once;

All rights reserved by Yami.

Return Policy

Gift card that has already been consumed is non-refundable.

Sold by JD@CHINA

Service Guarantee

Yami Free Shipping over $49
Yami Easy Returns
Yami Ships from United States

Shipping

  • United States

    Standard Shipping is $5.99 (Excluding Alaska & Hawaii). Free on orders of $49 or more.

    Local Express is $5.99 (Available in Parts of CA, NJ, MA & PA). Free on orders of $49 or more.

    2-Day Express (Includes Alaska & Hawaii) starts at $19.99.

Return Policy

You may return product within 30 days upon receiving the product. Items returned must be new in it's original packing, including the original invoice for the purchase. Customer return product at their own expense.

Sold by JD@CHINA

Service Guarantee

Yami Cross-store Free Shipping over $69
Yami 30-days Return

Yami-China FC

Yami has a consolidation warehouse in China which collects multiple sellers’ packages and combines to one order. Our Yami consolidation warehouse will directly ship the packages to your door. Cross-store free shipping over $69.

Return Policy

You may return products within 30 days upon receiving the products. Sellers take responsibilities for any wrong shipment or missing items. Packing needs to be unopened for any other than quality issues return. We promise to pack carefully, but because goods are taking long journey to destinations, simple damages to packaging may occur. Any damages not causing internal goods quality problems are not allowed to return. If you open the package and any quality problem is found, please contact customer service within three days after receipt of goods.

Shipping Information

Yami Consolidation Service Shipping Fee $9.99(Free shipping over $69)

Sellers in China will ship their orders within 1-2 business days once the order is placed. Packages are sent to our consolidation warehouse in China and combined there. Our Yami consolidation warehouse will directly ship the packages to you via UPS. The average time for UPS to ship from China to the United States is about 10 working days and it can be traced using the tracking number. Due to the pandemic, the delivery time may be delayed by about 5 days. The package needs to be signed by the guest. If the receipt is not signed, the customer shall bear the risk of loss of the package.

Sold by JD@CHINA

Service Guarantee

Free shipping over 69
Genuine guarantee

Shipping

Yami Consolidated Shipping $9.99(Free shipping over $69)


Seller will ship the orders within 1-2 business days. The logistics time limit is expected to be 7-15 working days. In case of customs clearance, the delivery time will be extended by 3-7 days. The final receipt date is subject to the information of the postal company.

Yami Points information

All items are excluding from any promotion or points events on Yamibuy.com

Return Policy

You may return product within 30 days upon receiving the product. Items returned must be new in it's original packing, including the original invoice for the purchase. Customer return product at their own expense.

Yami

Download the Yami App

Back Top

Recommended for You

About the brand

Jingdong book

为您推荐

Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折
Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折
Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折
Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折
Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折
Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折

Reviews{{'('+ commentList.posts_count + ')'}}

Have your say. Be the first to help other guests.

Write a review
{{ totalRating }} Write a review
  • {{i}} star

    {{i}} stars

    {{ parseInt(commentRatingList[i]) }}%

Yami Yami
{{ comment.user_name }}

{{ showTranslate(comment) }}Show Less

{{ strLimit(comment,800) }}Show more

Show Original

{{ comment.content }}

Yami
Show All

{{ formatTime(comment.in_dtm) }} VERIFIED PURCHASE {{groupData}}

{{ comment.likes_count }} {{ comment.likes_count }} {{ comment.reply_count }} {{comment.in_user==uid ? __('Delete') : __('Report')}}
Yami Yami
{{ comment.user_name }}

{{ showTranslate(comment) }}Show Less

{{ strLimit(comment,800) }}Show more

Show Original

{{ comment.content }}

Yami
Show All

{{ formatTime(comment.in_dtm) }} VERIFIED PURCHASE {{groupData}}

{{ comment.likes_count }} {{ comment.likes_count }} {{ comment.reply_count }} {{comment.in_user==uid ? __('Delete') : __('Report')}}

No related comment~

Review

Yami Yami

{{ showTranslate(commentDetails) }}Show Less

{{ strLimit(commentDetails,800) }}Show more

Show Original

{{ commentDetails.content }}

Yami
Show All

{{ formatTime(commentDetails.in_dtm) }} VERIFIED PURCHASE {{groupData}}

{{ commentDetails.likes_count }} {{ commentDetails.likes_count }} {{ commentDetails.reply_count }} {{commentDetails.in_user==uid ? __('Delete') : __('Report')}}

Please write at least one word

Comments{{'(' + replyList.length + ')'}}

Yami Yami

{{ showTranslate(reply) }}Show Less

{{ strLimit(reply,800) }}Show more

Show Original

{{ reply.reply_content }}

{{ formatTime(reply.reply_in_dtm) }}

{{ reply.reply_likes_count }} {{ reply.reply_likes_count }} {{ reply.reply_reply_count }} {{reply.reply_in_user==uid ? __('Delete') : __('Report')}}

Please write at least one word

Cancel

That’s all the comments so far!

Write a review
How would you rate this item?

Please add your comment.

  • A nice nickname will make your comments more popular!
  • The nickname in your account will be changed to the same as here.
Thanks for your review
Our community rely on great reviews like yours to find the best of Asia.

Report

If you find this content inappropriate and think it should be removed from the Yami.com site, let us know please.

Cancel

Are you sure to delete your review?

Cancel

You’ve Recently Viewed

About the brand

Jingdong book