PYTHON PROGRAMMING Create a list with the name “friends” and store name of any five friends
pls answer correctly
it's important
Answers
Answered by
2
The Code:
The given problem is solved using Python.
# Declare a list of 5 friends.
friends=['James','Joseph','Jacob','Alexander','Oliver']
# Display your friends name.
print(*friends,sep=', ')
The Output:
>> James, Joseph, Jacob, Alexander, Oliver
See attachment for verification.
Learn More:
List: In Python, list is used to store multiple items in a single variable.
Properties of lists:
- Ordered: List has a definite order. It will not be changed.
- Mutable: We can add, delete elements present in a list.
- A list allow duplicate values.
- A list can be nested.
Attachments:
![](https://hi-static.z-dn.net/files/dca/f06ceb6163a91ac63417101ccc5e3b43.jpg)
Similar questions