PROPOSED EXERCISES
|
PAGE 1 / 1
|
Lists
Proposed Exercises
For better understanding, solve the following tasks.
Given the
two lists already written in the editor, try to solve the
following tasks:
a) Considering that each person has an associated age at the same index, display as below:
Mark is 14 years old.
George is 23 years old.
...
b) Add at the end of the lists, respectively, the data:
Andreea,
34 and
David,
23.
Print both lists afterwards.
c) Delete the data from both lists about
Anna (pay attention to the indices).
d) Display the first three elements from the
name list.
e) Display the
name list from right to left.
f) Print the elements with indices
2 and
4, then from
0 to
5 from both lists.