20160727 Wednesday——————————————————————————————
Udacity数据分析课程的前菜,python 和概率
Prerequisites
Before you begin, it is important that you are sure you have the pre-requisite knowledge and study habits you will need in order to be successful in the Data Analyst Nanodegree program.
In the Readiness Assessment you will get your hands dirty with a little programming and probability in addition to reflecting on your study habits.
Programming
If you feel that you don't yet have the necessary programming background for this program, you can take the following courses on Udacity to prepare:
Intro to Computer Science
Programming Foundations with Python
Statistics
We've found that many students who enroll in the Data Analyst Nanodegree Program have taken statistics sometime prior to their enrollment, but often they need review of certain key concepts in order to be successful. With this in mind, the first course in this Nanodegree Program will help you review statistics, beginning with a special placement advisor, which will tell you the specific lessons you need to work through. As a result of this addition, you will not be asked any questions about statistics in the following Readiness Assessment.
Pay attention to the feedback that will appear in the box to the right after each submission. It's okay if you don't get the questions right the first time. Go to the resources that we share with you to review or learn something new. Once you've done that, you can come back and try the questions again!
一周十小时
'''
Programming background in Python.
The first exercise allows you to assess your ability to program in Python.
As a data analyst, you will spend much of your time writing code and
programs to work with data or to build mathematical, statistical, or
machine learning models to find insights from data.
Complete this function that transforms a list of integers整数.
1) For numbers that are multiples of three replace the integer with the string "Fizz".
用3整除,就是除以3,余数为0
2) For numbers that are multiples of five replace the integer with the string "Buzz".
3) For numbers that are multiples of both three AND five replace the integer
with the string "FizzBuzz"
Your function should take in a list of integers as input.
Your function should not modify the input list.
Your function should return an updated list with integers and strings.
'''
def fizzbuzz(intList):
'''
Your fizzbuzz function. The grader will run `fizzbuzz(intList)` to check if your
function returns the correct output.
intList: list containing integers
Make sure you write the script so that your algorithm is part of the
function; you do not need to call the function yourself.
'''
# YOUR CODE HERE