Intro to Programming and Data Science (Summer 2020)/Day 4 Coding Challenges: Difference between revisions

From CommunityData
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Python for Everybody ==
== Python for Everybody ==


Chapter 7: Exercises 1, 2, 3
Chapter 7:
* Exercise 1: Tamara
* Exercise 2: Vanessa
* Exercise 3: Zhaozhe


 
=== Wordplay Level 2 ===
== Baby Names ==
<ul>
Using the baby names data from [[Intro_to_Programming_and_Data_Science_(Summer_2020)/Day_3_Coding_Challenges|The day 3 challenges]]:
<li> For every letter, print the word that uses that character the most. Hint: use two nested for loops. First one is   
# Get the ratio of names that start with each letter.
<source lang='python'>
#* Do this for boys and girls.
for letter in 'abcdefghijklmnopqrstuvwxyz':
#* '''Hint''' First line of output should be something like:
    # do something
#*:  <pre>a: boys: 0.1002914920750592 girls: 0.17587602795796703</pre>
</source>
# Are girls or boys more likely to have a name that is used by both genders?
</li>
# Figure out how to change the ssadata.py file so that it loads births from 2017 instead of 2018.
<ul>
 
<li> Carly </li>
== Above and beyond ==
</ul>
# Figure out how to load two years of birth data simultaneously and compare them (e.g., identify the top 20 names from 2017 and figure out how many more/fewer people were named those names in 2018).
</ul>
# Visualize some of the differences (probably in Excel)
* Find the longest string where no character appears more than 1 time. (Hint: look up counters)
** Jessie
* Use Python to find one other interesting fact about the data set. Examples (that you can't use) might be:
** One of the words that is tied for the most vowels is aquifoliaceous
** The word with the highest consonant to vowel ratio is sulphhydryls
** Ji-Young, Naomi, Tiwalade, Yihan, Nate

Latest revision as of 17:31, 20 May 2020

Python for Everybody[edit]

Chapter 7:

  • Exercise 1: Tamara
  • Exercise 2: Vanessa
  • Exercise 3: Zhaozhe

Wordplay Level 2[edit]

  • For every letter, print the word that uses that character the most. Hint: use two nested for loops. First one is
    for letter in 'abcdefghijklmnopqrstuvwxyz':
        # do something
    
    • Carly
  • Find the longest string where no character appears more than 1 time. (Hint: look up counters)
    • Jessie
  • Use Python to find one other interesting fact about the data set. Examples (that you can't use) might be:
    • One of the words that is tied for the most vowels is aquifoliaceous
    • The word with the highest consonant to vowel ratio is sulphhydryls
    • Ji-Young, Naomi, Tiwalade, Yihan, Nate