{ "cells": [ { "cell_type": "markdown", "metadata": { "pycharm": { "name": "#%% md\n" } }, "source": [ "# Second assignment" ] }, { "cell_type": "markdown", "metadata": { "pycharm": { "name": "#%% md\n" } }, "source": [ "## `str.upper()`, `str.lower()`, `str.title()`\n", "\n", "Fill `____` pieces below to have correct values for `lower_cased`, `upper_cased` and `title_cased` variables." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "pycharm": { "name": "#%%\n" } }, "outputs": [], "source": [ "original_string = 'Ocademy is so COOL!'" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "pycharm": { "name": "#%%\n" } }, "outputs": [], "source": [ "# Your code here:\n", "\n", "lower_cased = original_string.____\n", "upper_cased = ____.upper()\n", "title_cased = ____.____" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide_input": false, "pycharm": { "name": "#%%\n" } }, "outputs": [], "source": [ "# Let's verify that the implementation is correct by running the cell below\n", "# `assert` will raise `AssertionError` if the statement is not true.\n", "assert lower_cased == 'ocademy is so cool!'\n", "assert upper_cased == 'OCADEMY IS SO COOL!'\n", "assert title_cased == 'Ocademy Is So Cool!'" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.13 (main, May 24 2022, 21:28:31) \n[Clang 13.1.6 (clang-1316.0.21.2)]" }, "vscode": { "interpreter": { "hash": "aee8b7b246df8f9039afb4144a1f6fd8d2ca17a180786b69acc140d282b71a49" } } }, "nbformat": 4, "nbformat_minor": 2 }