[Course] Advanced Computer Programming, Homework, week 1

Advanced Computer Programming, Homework, week 1


1.浏览Python主页(https://www.python.org/),在博客上写下你有哪些发现和收获

I visited Python’s homepage one year ago, but I just downloaded the installation package at that time.
At this time, I find some key messages below.

这里写图片描述

Looking at the picture above, we may have a general knowledge of the usages of Python. I have used some packages in the first three parts, such as tkInter, PyQt, SciPy, Pandas and so forth.

Python have a lot of packages, it’s impossible to be familiar with every package. Learning of the packages which we need is enough. For instance, now I’m major in the machine learning and data mining, so I choose Anaconda, which consists of many scientific computation packages.


此外,官网还给出了文档和交流社区,这些对于初学者来说都是不错的学习资源

学会看官方文档非常重要,因为Python有各种各样的Package,Package最好的学习途径便是官方文档


2.假设你已经成为一名Python编程高手,你打算实现怎样的程序?在博客上写下你的目标

If I become a Python programming master, I will do the things below,

  • Data Mining
  • Machine Learning
  • Web Development
  • Simple Game

I have wrote some programs about the first three, but I haven’t used Python to write a game.


3.教材中课后的练习,2-1到2-11,选一些写到你的博客上

以下代码通过 Jupyter notebook 导出Markdown源码

# 2-1 简单消息
变量 = '消息'
print(变量)
消息

# 2-2 多条简单消息
变量 = 'new message'
print(变量)
new message

# 2-3 个性化消息
name = 'Eric'
print('Hello', name + ', would you like to learn some Python today?')
Hello Eric, would you like to learn some Python today?

# 2-4 调整名字的大小写
name = 'Geass Taiga'
print(name.lower())
print(name.upper())
print(name.title())
geass taiga
GEASS TAIGA
Geass Taiga
# 2-5 名言
print('Albert Einstein once said, "A person who never made a mistake never tried anything new."')
Albert Einstein once said, "A person who never made a mistake never tried anything new."

# 2-6 名言2
famous_person = 'Albert Einstein'
message = 'A person who never made a mistake never tried anything new.'
print(famous_person, 'once said, "' + message + '"')
Albert Einstein once said, "A person who never made a mistake never tried anything new."

# 2-7 删除人名中的空白
name = "  Geass Taiga  \n\t  "
print(name)
print(name.lstrip())
print(name.rstrip())
print(name.strip())
  Geass Taiga  

Geass Taiga  

  Geass Taiga
Geass Taiga
# 2-8 数字8
print(1+7)
print(9-1)
print(2*4)
print(16//2)
8
8
8
8
# 2-9 最喜欢的数字
num = 4
print("My favorite number is: ", num)
My favorite number is:  4

# 2-10 添加注释
# 输出列表
[x**2 for x in range(6)]
[0, 1, 4, 9, 16, 25]
# 2-11 Python之禅
import this
The Zen of Python, by Tim Peters

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
《A First Course in Statistical Programming with R》是由剑桥大学出版社出版的一本统计编程入门教材。该书旨在向学习者介绍如何使用R语言进行统计编程。R语言是一种开源的统计和数据分析软件,广泛用于数据处理、数据可视化和统计建模等领域。 这本书的内容非常系统和全面,适合初学者使用。首先,书中介绍了R语言的基础知识和语法规则,包括变量、函数、数据类型和流程控制等;其次,书中详细介绍了如何在R中进行数据处理和数据可视化,例如读取数据、处理缺失值、计算统计量和绘制图形等;最后,书中还介绍了如何用R进行统计建模,包括线性回归、逻辑回归和聚类分析等。 这本书的优点在于它既注重理论知识的讲解,又注重实践操作的指导。每一章都包含了大量的实例和练习,帮助读者巩固所学的内容。此外,书中还附有大量的R代码和数据集,读者可以通过实际操作来学习和理解统计编程的过程。 总之,《A First Course in Statistical Programming with R》是一本理论与实践并重的统计编程入门教材。通过学习这本书,读者将对R语言的基础知识有一个全面的了解,并能够独立运用R进行数据处理、数据可视化和统计建模。无论是对于统计学专业的学生还是对于从事数据科学和数据分析工作的人员,这本书都是一本非常有价值的参考教材。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值