Intro to Programming and Data Science (Summer 2021)/Day 4 Coding Challenges: Difference between revisions
From CommunityData
(Copying content from previous class) |
No edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
Chapter 7: | Chapter 7: | ||
* | * Exercises 1, 2, and 3 | ||
=== Wordplay Level 2 === | === Wordplay Level 2 === | ||
* For every letter, print the word that uses that character the most. Hint: use two nested for loops. First one is | |||
< | <syntaxhighlight lang='python'> | ||
for letter in 'abcdefghijklmnopqrstuvwxyz': | for letter in 'abcdefghijklmnopqrstuvwxyz': | ||
# do something | # do something | ||
</ | </syntaxhighlight> | ||
* Find the longest string where no character appears more than 1 time. (Hint: look up counters) | * Find the longest string where no character appears more than 1 time. (Hint: look up counters) | ||
* Use Python to find one other interesting fact about the data set. Examples (that you can't use) might be: | * 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 | ** One of the words that is tied for the most vowels is aquifoliaceous | ||
** The word with the highest consonant to vowel ratio is sulphhydryls | ** The word with the highest consonant to vowel ratio is sulphhydryls | ||
Latest revision as of 18:34, 19 May 2021
Python for Everybody[edit]
Chapter 7:
- Exercises 1, 2, and 3
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
- Find the longest string where no character appears more than 1 time. (Hint: look up counters)
- 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