From ab69290f408f071bffb3dfcefeda21f9eaf11a32 Mon Sep 17 00:00:00 2001 From: Viktor <81253033+Viktor-Kiptev@users.noreply.github.com> Date: Mon, 5 Dec 2022 10:31:58 +0100 Subject: [PATCH] Update Day 9.md Add one more --- Status/Day 9.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Status/Day 9.md b/Status/Day 9.md index e71b8fd..46340b0 100644 --- a/Status/Day 9.md +++ b/Status/Day 9.md @@ -66,6 +66,19 @@ print(n) print(type(n)) # checks the type of the variable ``` + +**Solution by VK** +```python +def ConvertStrToInt (data): + if type(data) == int: + return str(data) + else: + return f'Expected int, received {type(data)}' +x = 10 +print(type(ConvertStrToInt(x))) +print(ConvertStrToInt(x)) +``` + --- # Question 28