Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- friends = ["Kevin", "Karen", "Jim"];
- print(friends);
- print(friends[0]);
- print(friends[1]);
- print(friends[2]);
- print("\n");
- index = input("Enter a number: ");
- print("Friend in index " + str(index) + " is " + friends[int(index) % 3]);
- print("\n");
- newFriends = ["Friend0", "Friend1", "Friend2", "Friend3", "Friend4"];
- print(newFriends);
- print(newFriends[1:]);
- print(newFriends[2:]);
- print(newFriends[0:2]);
- print("\n");
- newList = newFriends[2:]
- print(newList);
- print("\n");
- newFriends[0] = "Friend10";
- print(newFriends);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement