{ "cells": [ { "cell_type": "code", "execution_count": 72, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'Frank'" ] }, "execution_count": 72, "metadata": {}, "output_type": "execute_result" } ], "source": [ "(walrus_name := \"Frank\")" ] }, { "cell_type": "code", "execution_count": 73, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "My favorite walrus is named Frank!\n" ] } ], "source": [ "walrus_name = \"Frank\"\n", "print(f'My favorite walrus is named {walrus_name}!')" ] }, { "cell_type": "code", "execution_count": 74, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "My favorite walrus is named Frank!\n" ] } ], "source": [ "walrus_name = \"Frank\"\n", "print(f'My favorite walrus is named {walrus_name}!')" ] }, { "cell_type": "code", "execution_count": 75, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Have you met the greatest of the walruses, Frank Ocean?\n" ] } ], "source": [ "walrus_name = \"Frank\"\n", "walrus_last_name = \"Ocean\"\n", "walrus_full_name = walrus_name + ' ' + walrus_last_name\n", "print(f'''Have you met the greatest of the walruses, {\n", " walrus_full_name}?''')" ] }, { "cell_type": "code", "execution_count": 76, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Have you met the greatest of the walruses,Frank Ocean?\n" ] } ], "source": [ "print(f'''Have you met the greatest of the walruses,{\n", " (walrus_full_name := (walrus_name := \"Frank\") +\n", " \" \" +\n", " (walrus_last_name := \"Ocean\")\n", " )\n", "}?''')" ] }, { "cell_type": "code", "execution_count": 77, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Have you met the greatest of the walruses, Frank Ocean\n" ] } ], "source": [ "walrus_name = \"Frank\"\n", "walrus_last_name = \"Ocean\"\n", "print(f'''Have you met the greatest of the walruses, {\n", " (walrus_full_name := walrus_name + \" \" + walrus_last_name)\n", "}''')" ] }, { "cell_type": "code", "execution_count": 78, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "64\n" ] } ], "source": [ "n = 8\n", "\n", "if((check:=n**2) >= 50):\n", " print(check)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "\n", "user_input = input(\"What's your favorite arctic mammal? > \")\n", "\n", "while user_input.lower() != 'walrus':\n", " print(f'{user_input} is WRONG!')\n", " user_input = input(\"What's your favorite arctic mammal? > \")" ] }, { "cell_type": "code", "execution_count": 80, "metadata": {}, "outputs": [], "source": [ "while (user_input := input(\"What's your favorite arctic mammal? > \").lower()) != 'walrus':\n", " print(f'{user_input} is WRONG!')" ] }, { "cell_type": "code", "execution_count": 81, "metadata": {}, "outputs": [], "source": [ "import pandas as pd" ] }, { "cell_type": "code", "execution_count": 82, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | date | \n", "new_cases | \n", "cum_cases | \n", "new_death | \n", "cum_death | \n", "new_recovered | \n", "cum_recovered | \n", "cum_active_cases | \n", "
---|---|---|---|---|---|---|---|---|
0 | \n", "2020-01-30 | \n", "1 | \n", "1 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "1 | \n", "
1 | \n", "2020-01-31 | \n", "0 | \n", "1 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "1 | \n", "
2 | \n", "2020-02-01 | \n", "0 | \n", "1 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "1 | \n", "
3 | \n", "2020-02-02 | \n", "1 | \n", "2 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "2 | \n", "
4 | \n", "2020-02-03 | \n", "1 | \n", "3 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "3 | \n", "
\n", " | date | \n", "cum_cases | \n", "new_cases | \n", "calculated_cases | \n", "
---|---|---|---|---|
0 | \n", "2020-01-30 | \n", "1 | \n", "1 | \n", "1 | \n", "
1 | \n", "2020-01-31 | \n", "1 | \n", "0 | \n", "0 | \n", "
2 | \n", "2020-02-01 | \n", "1 | \n", "0 | \n", "0 | \n", "
3 | \n", "2020-02-02 | \n", "2 | \n", "1 | \n", "1 | \n", "
4 | \n", "2020-02-03 | \n", "3 | \n", "1 | \n", "1 | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
636 | \n", "2021-10-27 | \n", "34231030 | \n", "16351 | \n", "16351 | \n", "
637 | \n", "2021-10-28 | \n", "34245337 | \n", "14307 | \n", "14307 | \n", "
638 | \n", "2021-10-29 | \n", "34259552 | \n", "14215 | \n", "14215 | \n", "
639 | \n", "2021-10-30 | \n", "34272492 | \n", "12940 | \n", "12940 | \n", "
640 | \n", "2021-10-31 | \n", "34285399 | \n", "12907 | \n", "12907 | \n", "
641 rows × 4 columns
\n", "