-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path3-5.py
More file actions
21 lines (18 loc) · 757 Bytes
/
3-5.py
File metadata and controls
21 lines (18 loc) · 757 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
inviteList = ["Ali" , "Sara" , "Saad"];
print("First Set of Invitation");
print("------------------------");
for invitePerson in inviteList:
print("Hello " + invitePerson + "," + " I would like to invite you for today's dinner.");
personCantMake = "Sara";
print("\n" + personCantMake + " cannot make dinner.");
# trying to get index for not coming person
indexCantMake = inviteList.index(personCantMake);
# alter list index name
inviteList[indexCantMake] = "Ahmed";
print("\n Modified List");
print("-------------");
print(inviteList);
print("\n Second Set of Invitation");
print("------------------------");
for invitePerson in inviteList:
print("Hello " + invitePerson + "," + " I would like to invite you for today's dinner.");