Skip to content

Commit 08fd69e

Browse files
authored
Update README.md
1 parent 76866fb commit 08fd69e

File tree

1 file changed

+24
-8
lines changed

1 file changed

+24
-8
lines changed
Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,28 @@
1-
# `23` List and touple
1+
# `23` List and tuple
22

3-
Write a program which accepts a sequence of comma-separated numbers from console and generate a list and a tuple which contains every number.
4-
Suppose the following input is supplied to the program:
5-
34,67,55,33,12,98
6-
Then, the output should be:
3+
## 📝 Instructions:
4+
5+
1. Create a function called `list_and_tuple()`, that given a input of `n` numbers returns a list and a tuple of those numbers and transforms each of them into a string.
6+
7+
## 📎 Example input:
8+
9+
```py
10+
list_and_tuple(34,67,55,33,12,98)
11+
```
12+
13+
## 📎 Example output:
14+
15+
```py
716
['34', '67', '55', '33', '12', '98']
817
('34', '67', '55', '33', '12', '98')
18+
```
19+
20+
## 💡 Hint:
21+
22+
+ The number of parameters accepted by the function is not limited.
23+
24+
+ To make a function that accepts an unlimited number of arguments, use the `*` operator and then any name you want for it. For example:
925

10-
Hints:
11-
In case of input data being supplied to the question, it should be assumed to be a console input.
12-
tuple() method can convert list to tuple
26+
```py
27+
def my_function(*args)
28+
```

0 commit comments

Comments
 (0)