|
345 | 345 | "outputs": [], |
346 | 346 | "source": [ |
347 | 347 | "%%ipytest\n", |
348 | | - "def solution_addition_multiplication(a, b, c):\n", |
| 348 | + "def solution_addition_multiplication(a: float, b:float, c:float) -> float:\n", |
349 | 349 | " # Your code starts here\n", |
350 | 350 | " solution =\n", |
351 | 351 | " # Your code ends here\n", |
|
361 | 361 | "outputs": [], |
362 | 362 | "source": [ |
363 | 363 | "%%ipytest\n", |
364 | | - "def solution_circle_area(r):\n", |
| 364 | + "def solution_circle_area(r: float) -> float:\n", |
365 | 365 | " # Your code starts here\n", |
366 | 366 | " solution =\n", |
367 | 367 | " # Your code ends here\n", |
|
378 | 378 | "outputs": [], |
379 | 379 | "source": [ |
380 | 380 | "%%ipytest\n", |
381 | | - "def solution_quadratic_equation(a, b, c):\n", |
| 381 | + "def solution_quadratic_equation(a: float, b: float, c: float) -> float:\n", |
382 | 382 | " # Your code starts here\n", |
383 | 383 | " solution1 =\n", |
384 | 384 | " solution2 =\n", |
|
689 | 689 | "source": [ |
690 | 690 | "%%ipytest\n", |
691 | 691 | "\n", |
692 | | - "def solution_a_plus_b_equals_c(a, b, c):\n", |
| 692 | + "def solution_a_plus_b_equals_c(a: float, b: float, c: float) -> float:\n", |
693 | 693 | " # Your code starts here\n", |
694 | 694 | " return\n", |
695 | 695 | " # Your code ends here\n" |
|
705 | 705 | "source": [ |
706 | 706 | "%%ipytest\n", |
707 | 707 | "\n", |
708 | | - "def solution_number_is_even(number):\n", |
| 708 | + "def solution_number_is_even(number: float) -> bool:\n", |
709 | 709 | " # Your code starts here\n", |
710 | 710 | " return number\n", |
711 | 711 | " # Your code ends here\n" |
|
719 | 719 | "source": [ |
720 | 720 | "%%ipytest\n", |
721 | 721 | "\n", |
722 | | - "def solution_number_is_greater_than_zero(number):\n", |
| 722 | + "def solution_number_is_greater_than_zero(number: float) -> bool:\n", |
723 | 723 | " # Your code starts here\n", |
724 | 724 | " return\n", |
725 | 725 | " # Your code ends here" |
|
910 | 910 | "source": [ |
911 | 911 | "%%ipytest\n", |
912 | 912 | "\n", |
913 | | - "def solution_number_is_positive_and_even(number):\n", |
| 913 | + "def solution_number_is_positive_and_even(number: float) -> bool:\n", |
914 | 914 | " # Your code starts here\n", |
915 | 915 | " return\n", |
916 | 916 | " # Your code ends here" |
|
926 | 926 | "source": [ |
927 | 927 | "%%ipytest\n", |
928 | 928 | "\n", |
929 | | - "def solution_number_is_lower_than_0_or_greater_than_100(number):\n", |
| 929 | + "def solution_number_is_lower_than_0_or_greater_than_100(number: float) -> bool:\n", |
930 | 930 | " # Your code starts here\n", |
931 | 931 | " return\n", |
932 | 932 | " # Your code ends here" |
|
1272 | 1272 | "source": [ |
1273 | 1273 | "%%ipytest\n", |
1274 | 1274 | "\n", |
1275 | | - "def solution_remove_every_second_element_from_list(my_list):\n", |
| 1275 | + "def solution_remove_every_second_element_from_list(my_list: list[float]) -> list[float]:\n", |
1276 | 1276 | " # Your code starts here\n", |
1277 | 1277 | " return\n", |
1278 | 1278 | " # Your code ends here" |
|
1288 | 1288 | "source": [ |
1289 | 1289 | "%%ipytest\n", |
1290 | 1290 | "\n", |
1291 | | - "def solution_return_first_and_last_element_from_list(my_list):\n", |
| 1291 | + "def solution_return_first_and_last_element_from_list(my_list: list[float]) -> list[float]:\n", |
1292 | 1292 | " # Your code starts here\n", |
1293 | 1293 | " return\n", |
1294 | 1294 | " # Your code ends here" |
|
1304 | 1304 | "source": [ |
1305 | 1305 | "%%ipytest\n", |
1306 | 1306 | "\n", |
1307 | | - "def solution_first_and_last_element_are_equal(my_list):\n", |
| 1307 | + "def solution_first_and_last_element_are_equal(my_list: list[float]) -> bool:\n", |
1308 | 1308 | " # Your code starts here\n", |
1309 | 1309 | " return\n", |
1310 | 1310 | " # Your code ends here" |
|
1320 | 1320 | "source": [ |
1321 | 1321 | "%%ipytest\n", |
1322 | 1322 | "\n", |
1323 | | - "def solution_lists_are_equal(list1, list2):\n", |
| 1323 | + "def solution_lists_are_equal(list1: list, list2: list) -> bool:\n", |
1324 | 1324 | " # Your code starts here\n", |
1325 | 1325 | " return\n", |
1326 | 1326 | " # Your code ends here" |
|
1336 | 1336 | "source": [ |
1337 | 1337 | "%%ipytest\n", |
1338 | 1338 | "\n", |
1339 | | - "def solution_lists_are_equal_but_not_same(list1, list2):\n", |
| 1339 | + "def solution_lists_are_equal_but_not_same(list1: list, list2: list) -> bool:\n", |
1340 | 1340 | " # Your code starts here\n", |
1341 | 1341 | " return\n", |
1342 | 1342 | " # Your code ends here" |
|
1352 | 1352 | "source": [ |
1353 | 1353 | "%%ipytest\n", |
1354 | 1354 | "\n", |
1355 | | - "def solution_greater_or_equal(list1, list2):\n", |
| 1355 | + "def solution_greater_or_equal(list1: list, list2: list) -> bool:\n", |
1356 | 1356 | " # Your code starts here\n", |
1357 | 1357 | " return\n", |
1358 | 1358 | " # Your code ends here" |
|
1832 | 1832 | "source": [ |
1833 | 1833 | "%%ipytest\n", |
1834 | 1834 | "\n", |
1835 | | - "def solution_sets_union(set1, set2):\n", |
| 1835 | + "def solution_sets_union(set1: set, set2: set) -> set:\n", |
1836 | 1836 | " # Your code starts here\n", |
1837 | 1837 | " return\n", |
1838 | 1838 | " # Your code ends here" |
|
1846 | 1846 | "source": [ |
1847 | 1847 | "%%ipytest\n", |
1848 | 1848 | "\n", |
1849 | | - "def solution_sets_intersection(set1, set2):\n", |
| 1849 | + "def solution_sets_intersection(set1: set, set2: set) -> set:\n", |
1850 | 1850 | " # Your code starts here\n", |
1851 | 1851 | " return\n", |
1852 | 1852 | " # Your code ends here" |
|
1860 | 1860 | "source": [ |
1861 | 1861 | "%%ipytest\n", |
1862 | 1862 | "\n", |
1863 | | - "def solution_sets_difference(set1, set2):\n", |
| 1863 | + "def solution_sets_difference(set1: set, set2: set) -> set:\n", |
1864 | 1864 | " # Your code starts here\n", |
1865 | 1865 | " return\n", |
1866 | 1866 | " # Your code ends here" |
|
1874 | 1874 | "source": [ |
1875 | 1875 | "%%ipytest\n", |
1876 | 1876 | "\n", |
1877 | | - "def solution_sets_symmetric_difference(set1, set2):\n", |
| 1877 | + "def solution_sets_symmetric_difference(set1: set, set2: set) -> set:\n", |
1878 | 1878 | " # Your code starts here\n", |
1879 | 1879 | " return\n", |
1880 | 1880 | " # Your code ends here " |
|
1888 | 1888 | "source": [ |
1889 | 1889 | "%%ipytest\n", |
1890 | 1890 | "\n", |
1891 | | - "def solution_sets_subset(set1, set2):\n", |
| 1891 | + "def solution_sets_subset(set1: set, set2: set) -> set:\n", |
1892 | 1892 | " # Your code starts here\n", |
1893 | 1893 | " return\n", |
1894 | 1894 | " # Your code ends here" |
|
1902 | 1902 | "source": [ |
1903 | 1903 | "%%ipytest\n", |
1904 | 1904 | "\n", |
1905 | | - "def solution_sets_superset(set1, set2):\n", |
| 1905 | + "def solution_sets_superset(set1: set, set2: set) -> set:\n", |
1906 | 1906 | " # Your code starts here\n", |
1907 | 1907 | " return\n", |
1908 | 1908 | " # Your code ends here" |
|
1918 | 1918 | "source": [ |
1919 | 1919 | "%%ipytest\n", |
1920 | 1920 | "\n", |
1921 | | - "def solution_sets_disjoint(set1, set2):\n", |
| 1921 | + "def solution_sets_disjoint(set1: set, set2: set) -> set:\n", |
1922 | 1922 | " # Your code starts here\n", |
1923 | 1923 | " return\n", |
1924 | 1924 | " # Your code ends here" |
|
2085 | 2085 | "outputs": [], |
2086 | 2086 | "source": [ |
2087 | 2087 | "%%ipytest\n", |
2088 | | - "\n", |
2089 | | - "def solution_dict_return_value(my_dict, key):\n", |
| 2088 | + "import typing\n", |
| 2089 | + "T = typing.Typevar(\"T\")\n", |
| 2090 | + "def solution_dict_return_value(my_dict: dict[typing.Hashable, T], key: typing.Hashable) -> typing.Optional[T]:\n", |
2090 | 2091 | " # Your code starts here\n", |
2091 | 2092 | " return\n", |
2092 | 2093 | " # Your code ends here" |
|
2101 | 2102 | "outputs": [], |
2102 | 2103 | "source": [ |
2103 | 2104 | "%%ipytest\n", |
2104 | | - "\n", |
2105 | | - "def solution_dict_return_value_delete(my_dict, key):\n", |
| 2105 | + "import typing\n", |
| 2106 | + "T = typing.Typevar(\"T\")\n", |
| 2107 | + "def solution_dict_return_value_delete(my_dict: dict[typing.Hashable, T], key: typing.Hashable) -> typing.Optional[T]:\n", |
2106 | 2108 | " # Your code starts here\n", |
2107 | 2109 | " return\n", |
2108 | 2110 | " # Your code ends here" |
|
2118 | 2120 | "source": [ |
2119 | 2121 | "%%ipytest\n", |
2120 | 2122 | "\n", |
2121 | | - "def solution_update_one_dict_with_another(dict1, dict2):\n", |
| 2123 | + "def solution_update_one_dict_with_another(dict1: dict, dict2: dict) -> dict:\n", |
2122 | 2124 | " # Your code starts here\n", |
2123 | 2125 | " pass\n", |
2124 | 2126 | " # Your code ends here" |
|
2263 | 2265 | "source": [ |
2264 | 2266 | "%%ipytest\n", |
2265 | 2267 | "\n", |
2266 | | - "def solution_string_capitalize(my_string):\n", |
| 2268 | + "def solution_string_capitalize(my_string: str) -> str:\n", |
2267 | 2269 | " # Your code starts here\n", |
2268 | 2270 | " return\n", |
2269 | 2271 | " # Your code ends here" |
|
2279 | 2281 | "source": [ |
2280 | 2282 | "%%ipytest\n", |
2281 | 2283 | "\n", |
2282 | | - "def solution_string_lower_case(my_string):\n", |
| 2284 | + "def solution_string_lower_case(my_string: str) -> str:\n", |
2283 | 2285 | " # Your code starts here\n", |
2284 | 2286 | " return\n", |
2285 | 2287 | " # Your code ends here" |
|
2295 | 2297 | "source": [ |
2296 | 2298 | "%%ipytest\n", |
2297 | 2299 | "\n", |
2298 | | - "def solution_string_word_split(my_string):\n", |
| 2300 | + "def solution_string_word_split(my_string: str) -> str:\n", |
2299 | 2301 | " # Your code starts here\n", |
2300 | 2302 | " return\n", |
2301 | 2303 | " # Your code ends here" |
|
2311 | 2313 | "source": [ |
2312 | 2314 | "%%ipytest\n", |
2313 | 2315 | "\n", |
2314 | | - "def solution_string_join_commas(my_list):\n", |
| 2316 | + "def solution_string_join_commas(my_list: str) -> str:\n", |
2315 | 2317 | " # Your code starts here\n", |
2316 | 2318 | " return\n", |
2317 | 2319 | " # Your code ends here" |
|
2327 | 2329 | "source": [ |
2328 | 2330 | "%%ipytest\n", |
2329 | 2331 | "\n", |
2330 | | - "def solution_string_split_lines(my_string):\n", |
| 2332 | + "def solution_string_split_lines(my_string: str) -> list[str]:\n", |
2331 | 2333 | " # Your code starts here\n", |
2332 | 2334 | " return\n", |
2333 | 2335 | " # Your code ends here" |
|
0 commit comments