《Design of Computer Programs》学习笔记(1 - 3)Winning Poker Hands - Andy'S Corner

Winning Poker Hands

Andy’S Corner

视频链接:
Andy’S Corner - Udacity

1. Hello

2. List Comprehensions 1

3. 练习:List Comprehension 2

4. List Comprehension 3

5.练习: List Comprehension 4

我的答案:

#-----------------
# User Instructions
#
# Use a list comprehension to identify all the TAs 
# Who are teaching a 300 level course (which would
# be Gundega and Job). The string.find() function
# may be helpful to you.
#
# Your ta_300 variable should be a list of 2 strings:
# ta_300 = ['Gundega is the TA for CS373',
#           'Job is the TA for CS387']

ta_data = [['Peter', 'USA', 'CS262'],
           ['Andy', 'USA', 'CS212'],
           ['Sarah', 'England', 'CS101'],
           ['Gundega', 'Latvia', 'CS373'],
           ['Job', 'USA', 'CS387'],
           ['Sean', 'USA', 'CS253']]

ta_300 = [name + ' is the TA for ' + course 
          for name, country, course in ta_data 
          if int(course[2]) >= 3]# your code here
          # if course.find('CS3') != -1] Andy's code

for row in ta_300:
    print row

6. Rules Of Poker

参考文献:

  1. Design of Computer Programs - 英文介绍 - Udacity
  2. Design of Computer Programs - 中文介绍 - 果壳
  3. Design of Computer Programs - 视频列表 - Udacity
  4. Design of Computer Programs - 视频列表 - YouTube
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值