Beginner Python
12件の課題 · 学習順
- 1Say helloWrite `greet(name)` that returns the string `Hello, <name>!`.functionsf-stringsreturn5m
- 2Convert Celsius to FahrenheitWrite `to_fahrenheit(celsius)` returning the temperature in Fahrenheit.arithmeticfloatoperator precedence5m
- 3Even or oddWrite `even_or_odd(n)` that returns the string `"even"` when `n` divides by two exactly, and `"odd"` otherwise.moduloif/elsecomparison5m
- 4Add up to nWrite `sum_to(n)` returning the total of every whole number from 1 to `n` inclusive.for looprangeaccumulator6m
- 5Count the vowelsWrite `count_vowels(text)` returning how many vowels the text contains.iterationmembershipcase handling7m
- 6Reverse the word orderWrite `reverse_words(sentence)` that returns the sentence with its words in the opposite order.splitjoinslicing7m
- 7Find the largestWrite `largest(numbers)` returning the biggest value in the list.listscomparisonedge cases7m
- 8FizzBuzzWrite `fizzbuzz(n)` returning a list covering 1 to `n`.moduloelif orderinglists8m
- 9Measure each wordWrite `word_lengths(sentence)` returning a dictionary mapping each word to its length.dict buildingsplitlen8m
- 10Times tableWrite `times_table(n)` returning the twelve lines of the `n` times table as a list of strings.loopsstring formattinglists8m
- 11Palindrome checkWrite `is_palindrome(text)` returning `True` when the text reads the same forwards and backwards.normalisationslicingisalnum9m
- 12Score to letter gradeWrite `letter_grade(score)` turning a mark out of 100 into a letter.elif chainsboundariesvalidation8m