Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: another method of approaching problem with proper type casting #116

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
29 changes: 27 additions & 2 deletions Status/Day 2.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,30 @@ tpl = tuple(lst) # tuple method converts list to tuple
print(lst)
print(tpl)
```

---
```python

```python
'''solution by: minnielahoti
'''
print(tuple(input("Enter a series of numbers separated by a comma :").split(',')))
```

```python
'''solution by:@Bhuwan-web
'''
from typing import List, Tuple

raw_nums: str = input("give Comma seperated numbers: ")

mapped_nums: map = map(int, raw_nums.split(","))
listed_nums: List[int] = list(mapped_nums)
tuple_nums: Tuple = tuple(listed_nums)
if __name__ == "__main__":
print(listed_nums, tuple_nums, sep="\n")

```

---

# Question 5
Expand All @@ -66,7 +84,7 @@ print(tuple(input("Enter a series of numbers separated by a comma :").split(',')

### Hints:

> **_Use **init** method to construct some parameters_**
> **\_Use **init** method to construct some parameters\_**

---

Expand Down Expand Up @@ -217,7 +235,9 @@ D = input().split(',')
D = list(map(calc,D)) # applying calc function on D and storing as a list
print(",".join(D))
```

---

```python
'''Solution by: parian5
'''
Expand All @@ -226,7 +246,9 @@ C, H = 50, 30
mylist = input().split(',')
print(*(round(sqrt(2*C*int(D)/H)) for D in mylist), sep=",")
```

---

```python

'''Solution by: saxenaharsh24
Expand All @@ -241,6 +263,7 @@ for D in my_list:

print(','.join(map(str, x)))
```

---

# Question 7
Expand Down Expand Up @@ -351,7 +374,9 @@ lst = input().split(',')
lst.sort()
print(",".join(lst))
```

---

```python
'''Solution by Poonam-glitch
'''
Expand Down