• JUPYTER
  • FAQ
  • View as Code
  • Python 3 (ipykernel) Kernel
  • View on GitHub
  • Execute on Binder
  • Download Notebook
  1. learn-python3
  2. notebooks
  3. beginner
  4. exercises

1. Super vowels¶

Implement super_vowels function which takes a string as an argument and returns a modified version of that string. In the return value of super_vowels, all vowels should be in upper case whereas all consonants should be in lower case. The vowels are listed in the VOWELS variable.

In [ ]:
VOWELS = ["a", "e", "i", "o", "u"]
In [ ]:
# Your implementation here
In [ ]:
assert super_vowels("hi wassup!") == "hI wAssUp!"
assert super_vowels("HOw aRE You?") == "hOw ArE yOU?"

2. Playing board¶

Implement get_playing_board function which takes an integer as an argument. The function should return a string which resemples a playing board (e.g. a chess board). The board should contain as many rows and columns as requested by the interger argument. See the cell below for examples of desired behavior.

In [ ]:
# Your implementation here
In [ ]:
board_of_5 = " * * \n" "* * *\n" " * * \n" "* * *\n" " * * \n"

board_of_10 = (
    " * * * * *\n"
    "* * * * * \n"
    " * * * * *\n"
    "* * * * * \n"
    " * * * * *\n"
    "* * * * * \n"
    " * * * * *\n"
    "* * * * * \n"
    " * * * * *\n"
    "* * * * * \n"
)

assert get_playing_board(5) == board_of_5
assert get_playing_board(10) == board_of_10

print(get_playing_board(50))

This website does not host notebooks, it only renders notebooks available on other websites.

Delivered by Fastly, Rendered by OVHcloud

nbviewer GitHub repository.

nbviewer version: 8b013f7

nbconvert version: 7.2.3

Rendered (Tue, 10 Jun 2025 07:09:18 UTC)