exam
exam-2

Pass Python Institute PCAP Exam in First Attempt Guaranteed!

Get 100% Latest Exam Questions, Accurate & Verified Answers to Pass the Actual Exam!
30 Days Free Updates, Instant Download!

exam-3
block-premium
block-premium-1
Verified By Experts
PCAP Premium Bundle
$39.99

PCAP Premium Bundle

$69.98
$109.97
  • Premium File 141 Questions & Answers. Last update: Apr 10, 2024
  • Training Course 57 Lectures
  • Study Guide 320 Pages
 
$109.97
$69.98
block-screenshots
PCAP Exam Screenshot #1 PCAP Exam Screenshot #2 PCAP Exam Screenshot #3 PCAP Exam Screenshot #4 PrepAway PCAP Training Course Screenshot #1 PrepAway PCAP Training Course Screenshot #2 PrepAway PCAP Training Course Screenshot #3 PrepAway PCAP Training Course Screenshot #4 PrepAway PCAP Study Guide Screenshot #1 PrepAway PCAP Study Guide Screenshot #2 PrepAway PCAP Study Guide Screenshot #31 PrepAway PCAP Study Guide Screenshot #4
exam-4

Last Week Results!

470
Customers Passed Python Institute PCAP Exam
88%
Average Score In Actual Exam At Testing Centre
83%
Questions came word for word from this dump
exam-5
Download Free PCAP Exam Questions
Size: 3.23 MB
Downloads: 228
Size: 2.21 MB
Downloads: 1018
Size: 981.33 KB
Downloads: 1164
Size: 908.76 KB
Downloads: 1769
Size: 1.05 MB
Downloads: 1823
Size: 942.12 KB
Downloads: 1985
Size: 1.21 MB
Downloads: 1946
Size: 573.86 KB
Downloads: 2455
exam-11

Python Institute PCAP Practice Test Questions and Answers, Python Institute PCAP Exam Dumps - PrepAway

All Python Institute PCAP certification exam dumps, study guide, training courses are Prepared by industry experts. PrepAway's ETE files povide the PCAP Certified Associate in Python Programming practice test questions and answers & exam dumps, study guide and training courses help you study and pass hassle-free!

Lists, Tuples and Dictionaries

6. Dictionaries in Python

So dictionaries are exactly what they sound like when you open one. What do you have? You have words, and then you have the meaning of those words. As a result, it serves as both a key and a value. The word is the key, and the value of the actual definition of that word So a dictionary is exactly what that is. So, if I were to create a new dictionary, the syntax would be di CT DICT. Maybe that's not the right word, but let's stick with that. And so the way to define them is by using open, closed, or curly braces, all right? Curly braces are used instead of square brackets or parentheses.

And so the format of what this is going to be for each item in a dictionary is a key-value pair. Okay? So what we can do is say "K-1," which represents the key, and then you put a colon and then the actual value, and we can say some data, right? So, in order to obtain the valuable data, I would have to perform DICT. And then, in square brackets, we actually use the index. The index in dictionaries is no longer based on position. The index in lists is based on positions, just like it is in tuples. Tuples also use index numbers. Those are position-oriented structures. But dictionaries are not position-oriented; they are key-oriented. And so I have to actually know the key that I want the data to be retrieved from. So here the key is "one," all right? And so I can just print what this is going to equal. And so let's run this and notice that it gives some data. This is the actual value, and you can just obviously capture the value into a variable. So I'll just define a variable, dictionary at key one, right here.

This is the worth. And if I print the value, it'll just print some data. OK, so this is a dictionary with one item in it. If I want to add another item, I'll use a comma to separate it. So the next item will have key two or any key. It doesn't really matter. It can even be the number seven, for example. That's just a key. And then you use a colon and specify the actual data. And that data could be a list, an object, or some other string. In this case, I'll just say "other data." And now if I need to access the dictionary at key seven, remember there's not an index. This is a key. I would just put seven here, and I can just print what the value is going to be. So let's get this party started. And notice that it says other data. It is very important to keep in mind that this is not the index position; this is the key. So far, we only have two items in this dictionary, and they're both key-value pairs. So this is a key value pair, and this is a key value pair.

All right? Now this is a very flexible data structure, very similar to other data structures that are very flexible in Python, such as list tuples, which are a little restricted in that you can't change them, but dictionaries, which you can change them. So, for example, if I wanted to change other data to something else, I could refer to the key b seven. And this might be confusing. So what I'm going to do is just put a quote around it so that it's clear to you that this is not an index position. And so now I can't refer to it with an integer. I must use the actual key, and the key is string. So if I want to change the value of that key-value pair, I could just specify the new value. So let's just do it to make it obvious, new value. All right? And so then, once I do this, the value for the key seven has been permanently changed to this new string called "new value." And then I can just print the dictionary like that. Okay, let's get this party started. And there you go. We're printing the entire dictionary here. And so for the second key-value pair, the value has been changed to a new value. Same thing. If I wanted to change the value for the first item, I could just do Kone to specify the key and change that to a new value. All right? And so now let's run this. In this case, the value of the first key value pair has been changed to the new value. Okay, another important thing to note is that you cannot sort dictionaries, all right? They do not mean any kind of ordering or anything. You're just supposed to use keys and values with dictionaries.

So let's create something that makes a bit more sense than using these random keys and values. Let's say we have a dictionary that contains people and their weights. So I can do people's weight dictionaries,

okay? And then I can actually open and close the curly braces. And now the key could be the person's name. So let's say John, and the value could be their weight. So let's say there is £134. Okay? That's the first element in the dictionary. Obviously, I need a matrix to separate the different elements. So the next element is going to be "let's just do Mike," and let's say Mike is £170. And then the third item is going to be, say, Robert, and Robert is going to weigh 165. Okay? And so now I can print this so you can see what it is. If I wanted to change John's weight, why don't you try that? Pause the video, try that out, and you can resume watching me do it. But I would just do the people's weight dictionary at the top, John, and then change that to whatever. Let's say John gained a little bit of weight, so he's now £190. Okay? And so we print this dictionary again. As a result, you'll notice that John's weight has increased to 190. So dictionaries are mutable, right? just like lists. Now, since dictionaries can be modified, they're mutable. There is a method for retrieving items from the dictionary. Remember the pop method on the list? You can pop elements. It pops the last one by default, or you can do the same thing.

So, if I wanted to get rid of Mike after changing John's weight, we could actually pop him out of it. So you will use the pop method and then specify the key of the thing that we want to pop out. So we'll just do Mike. And so this will effectively change. It'll mutate and modify the dictionary after this line runs. And so now, at this point, we'll only have two values, John and Robert, with their weights in the dictionary. So let's wait. Run. And there we go. Now we only have Jon and Robert. Mike is out because we invoked the pop method. Now, for the pop method on a dictionary, you must give the key that you want to pop out. OK? In my lists, I believe I talk to you about this. When you use a pop, you don't have to indicate any given index position. You could just leave it empty, like a pop method. Like this, it was just empty, and by default, it would pop out the last value. However, when using dictionaries, you must provide a key. Now, pop doesn't just get rid of the element; it actually returns a value. When you use the pop command in a list, it now not only removes but also returns the item. And we can save it in some sort of variable. So same thing with pop; with dictionaries, when you do pop, it returns the value, okay?

It doesn't return the entire key-value pair; it returns the value. So if we name the variable "weight of Mike," we get the weight of Mike. So I'll also print the weight of mikein in another print statement, and that'll be the end of it. And so there you go. We know Mike's weight. It's 170. Not only that, but because we use and pop, the entire item was removed from the dictionary. That's why we only have two items left. We could now clear using the same method as before. I don't know if I talked about this. There's also a clear method. You can clear a dictionary completely, and it'll be an empty dictionary. You can run clear on a list, and that will empty out the list. It will still be a list, but it'll be an empty one. same thing with dictionaries. If you run clear, it'll still be a dictionary, but it will be an empty dictionary. And this, of course, modifies the actual dictionary so we don't have to. It's not like we're going to save this data into a new dictionary. It just puts it in place. And so now people wait; the dictionary will have nothing in it.

So let's get this party started. And there we go. It's an empty dictionary. Now I showed you how you can remove items from a dictionary by using the pop method with a given key. You might be wondering how you can add elements to a dictionary. Well, let's do that. Now I can actually use a similar syntax as I would for a list by using these open and closed brackets, now in square brackets, and give the actual key that I want to add to the dictionary. Let's say this new key is the number 99. Whatever, it doesn't really matter. And I assign something to it. So let's just say some data to make it easier to identify. And so now, at this point, we've permanently modified the people's dictionary. We've given it a new key, and we've given it a new value. So if we print the contents, that's where it runs. You'll see that this new data has been added to this dictionary. And if I want to access that, I can, of course, just access that new key by doing 99 right here. Make sure you surround it with quotes because the keys are not a number; they're an actual string. And so if you want to access that data, you have to make sure you get the key, right? So let's get this party started. And there you go. We obtain some information.

Now, like I said, dictionaries are pretty flexible. You can have all kinds of data in here. And so I can even have a list or a dictionary within a dictionary. So let's add another value here. So I'll just say that items, for example, are the key, and the actual value is orange and banana. All right, so this is the key, and this is the value. So, if I wanted to see what items contained, I could simply place them here. I don't need this. Let me get rid of this line of code. So let's get this party started. And there we go. As a list, we get orange and banana. So, of course, this will return those fruits to a list. Now if I want to access a particular element within the list, you guessed it, all I have to do is put it in, and hopefully you were able to figure that out. You just need brackets like this, and you specify the index position of the thing that you want to extract. So let's say banana. That's the indication one in that list. And so let's hit run, and it prints out a banana. Okay, now let me make this a bit more complex. I'm going to move this on to the next line.

And instead of having items, well, I'll leave items here, and inside of items, I'm going to have a dictionary. Okay, so the first item is orange. The second one is actually a dictionary. And so we'll say "K one," "nested," or "some value." It doesn't really matter. Okay, so now we have a dictionary in which we have a list, and inside of that list we have this dictionary. And so let's say I wanted to get this sum's value; how would you do it? Why don't you pause the video and try this out, and then you can resume watching my solution? Okay, welcome back. Hopefully that wasn't too difficult. So what you need to do if you want some value to be extracted is first get the key for the item that contains the list. So that's an item right here; we have that. And so then we have to refer to the index position of where the dictionary is, and that's here. So that's index position one. This is the second element on the list. The first element is orange, which has an index position of zero. The second item in that list has the index position 1. So we'll use that one. And now we are inside the dictionary again, aren't we? And so I have to refer to the actual key of the thing that I want. So that's going to be one like that. So let's get this party started. And there we go. We get some value, as expected. Now, one last thing. We're kind of just building all of this together, and I'm going to also involve a tuple now, okay, so let me just put a comma here.

And let's involve a tuple. So the final item is going to be the key tuple. All right? And the actual tuple is going to be a list of numbers: 12345. Now, again, you cannot change the contents of a tuple, can you? So let's first target the tuple. I'm going to do that outside of this printed statement. Let me just get rid of this. So I'm going to make people wait, and then we specify the actual key of the object that we want, and that's a tuple. And then this will actually return a tuple, which we'll call my tuple. And so I can print my tuple, and let's hit run, and this is that tuple. Okay, if I want to get the third element in that tuple, I would just use the index position two, and that will give me the third value, which is three. If I try to assign the tuple at inexpension three to the number 99, it won't even get to this line because the interpreter will crash because we're changing a tuple. You'll see; let's run this and boom. There you go. Tuple objects do not support item assignment. So whether it's in a dictionary, whether it's in a list, or in any structure, a list is changeable. But if an item in the list is a tuple, well, guess what? Tuples are not changeable.

So you cannot mutate them; you cannot change them. same thing with a dictionary. If you have lists, you can modify the contents of those lists. You can add and remove things from a dictionary. But if you have a tuple, you cannot modify that tuple structure. Okay? Now, can I take this tuple entirely from the dictionary? Certainly I can, because it is an item in the dictionary, isn't it? So let's do that. If I do "peopleweightdictionary dot pop" and specify the key of the item that I want to pop, it's going to be a tuple. Now, the dictionary is not going to contain the tuple at all. So let's get this party started. And there we go. Notice it no longer has that tuple. This is now being passed to the pop method, which always returns something. It returns the value in this case. So this is, of course, going to return the actual tuple that was removed. Okay. And so I can print that tuple right here and run it. That's, of course, going to be the tuple that was removed.

7. Comparison Operators

So far in the course, you've seen the equal sign used. And like I said, the equal sign is used for assignment. So if we have a variable here called Jeff, then I would assign Jeff, for example, a weight of 125 or whatever. It could be anything. I'm basically assigning a number to a variable. But what if I wanted to compare two things, to see if one is equal to the other? This is going to be crucial for controlling flow in a program.

And so for that, we use something called double equals. So there are two equal signs, and basically the idea is to put some value on the left, let's say the value ten, and some value on the right. In this case, We are no longer assigning tens to tens. That wouldn't make sense anyway, but we're not doing that. The two equal signs are basically comparing "ten equal to ten." And the result of this is going to be either true or false. Okay? So in this case, this is, of course, going to be true. So, if I print, I'm passing this expression to the print function, and we'll see what happens. When you hit run, you'll notice that it returns true. But if I change ten to, for example, nine, now this is no longer equal, right? So let's hit "run" and notice it returns false. So this is a key operator that you need to keep in mind: double equals, which is used for comparing the quality of two things. Same thing. If I have, for example, the word "hello" here and the word "hello" there, these are string comparisons. So now if we hit run, notice it's going to say true because both hello and hello spelled exactly the same with the same casing are going to be, of course, the same.

So it's true. But if I were to change this to a capital H, now it's a different story. It's no longer equal. So let's hit run, and notice it returns false, okay? Now if I have the number, for example, "5" here and in quotations I have "5" like that, this is also going to be false. Let's go for a run and see what happens. Notice it's false. Because comparison operators take type into account, understand? Just because this is a five and this is also a five doesn't mean they're equal. This one is a string, whereas this is a number, okay? If I were to change this to, for example, a 5.0 like that, this just happens so that it's true because they're both numbers. This is known as "truthy" in Python, meaning they're kind of pretty much true. So we might as well call it true. So five times five equals five; this will return true. Even though it's a different data type, let's hit run and true. This is a float data type, and this is an integer data type. But they're so similar that if I were to change this, of course, to five, then, of course, it's absolutely not true. Let's hit the ground running. Notice it's going to say "false," but with a zero. Python is smart enough to know that, "hey, we mean five," so it's going to return true for this. So expressions like these are known as boolean expressions, and we use these comparison operators, okay?

So if I were to, for example, change this to a ten and use the less than operator, which is like that, we're basically saying, is five less than ten? All right? If we evaluate this expression, is this true? And the answer is, of course, that it is true. So let's hit the ground running and notice that it's going to stay true. But if we change this the other way around and say that five is greater than ten, well, in this case, it's not true. So if you run it, notice it's going to say false, okay? There are also less than and equal to and greater than and equal to. So we can say, "Is five less than or equal to," for example, "five?" In this case, it will return true because five is, in fact, five, despite the fact that it is not greater than five. There is an equal sign there, so it's either greater than or equal to. So in this case, it's going to return true. Five is greater than or equal to four. If we change this to, say, a 3, it will still be true because five is greater than three, even though five is not equal to three. So let's get this party started. I notice it's going to say true, but if we change this to, for example, a six, now all of a sudden it's going to say false, because none of the conditions are met here. Five is not greater than six, nor is it equal to six. There's another operator known as the Bang in various programming languages, and that's the exclamation point.

And this essentially means no. So is five not equal to six? And this is, of course, going to return true because it returns true because five is, in fact, not equal to six. But if we change this to five, say, is five not equal to five? In this case, this should return false because, if we do the math, five is equal to five. However, if we test whether five is not equal to five, it will always return false. This is also known as a negation operator. Now, of course, if we have strings here, let's change this to a string and leave this as the integer five. This is a string five, and there's an integer five. It will suddenly become true down here, right? because the string five is in fact not equal to the integer five. Now, if I change this to "hello" and we both change this to "hello," This, of course, is going to return false because "hello is supposed to equal "hello." The case is the same, and the spelling is the same. But since we're checking to see whether "hello" is equal to "hello, it's of course going to say false. It is in fact equal to "hello." But if we change this to a capital H, I'm going through this step by step so you can understand it's going to return true in this case.

Now you can combine expressions like this. So, for example, we can have a double equals to see whether these are equal as well as some other condition. So if I put an or here, notice the syntax highlighting that went on. This means it's a reserved keyword in Python. So this means an or condition, and I can check to see whether some other condition is true or false. So I could say that "hello with a lowercase H" and "hello with a capital H" are equal, or "five is equal to five." In this case, the entire thing is evaluated. OK? And in this case, we have two comparisons going on here, one on the left and one on the right. And in this case, since we're using an or, either one of them could be true, either this one or this one. As a result, it will return true in this case because one of the expressions is true. So let's get this party started. I notice it's going to return true, but if I change this to a six, then of course both of the comparisons are going to return false. As a result, as you can see, this will return a false down here. And when you have multiple conditions being evaluated like this, oftentimes each condition is put in parentheses. And I like that practice; you should actually use the same one. I believe it is a better way to organise your code. So I'm going to wrap the first condition in parentheses so we can clearly see it's separate, and I'm going to wrap the second one in parentheses like that, so we can see that this is separate, and I can have another condition and say that and now and is another thing. and basically means that everything on the left should be true. and whatever's on the right should be true. Okay? So, if I put a true here, for example, I can use this true directly. What do you think this is going to return to? Remember, it's going to evaluate this whole thing first, and it's going to evaluate this. So since this is going to return false and this is going to be true, it's actually going to return false. So let's hit "run" and notice it returns false. If I change this from six to five, this side will now return a true. And because this is also true, it will return true overall.

Let's run this. It appears to be returning true. Instead of having a literal truth here, I can have an actual expression, and that could be the number eight in quotes, and say that if that is equal to the number eight in quotes. So this is, of course, also going to be evaluated as true, and it's going to give the same result true. Now, if I change this to "not equals," what do you think is going to be the result? Take a guess as to what's going to be printed. Try to evaluate this expression in your head and then run the code to see what it's going to print. So let's run this and notice it's going to return false. Because this, first of all, is, of course, false. Because the string eight is in fact equal to eight, we're checking to see if it's not. And so this is, of course, going to return false. And so, since we have an and here, even though this side evaluates to true in its entirety overall, since this side also should evaluate the truth for this thing to return true and it doesn't, it's going to return false. Let me now introduce you to or, which means that for this to return true, either the right side, which is here, or the left side must be true. Otherwise, if both of them are false, it's going to return false. If both of them are true, it will, by definition, return true.

So that's the or clause, which means both sides of the expression must be true for it to return true. So let me clean this up a little bit so that it's less complicated. And I'm going to introduce you to the operator. We examined the or and the conclusion. Or means at least one of the sides of the expression must be true for it to return true; otherwise, it would return false and would return true if both sides were true. As a matter of fact, let me go back for a second. The best way of doing this is, since this entire expression is supposed to be valued together, you might as well wrap it in parentheses like this, just to be extra clear. Okay, this is actually good practice. Programmers do this all the time, and you should too, since we expect this to be valued together. We want to just wrap this in its entirety in these parentheses and then separate it from it, and this is, of course, much more clear as to what's going on. So this is now going to, of course, return false. But if I change this to equal just to do a sanity check, it returns true. All right, so let me get rid of this again. So we discussed the and logical operators. There's one more I want to talk about, and that is the network operator. Now, it's not the exclamation point. That's one type, and the one I'm talking about here is with the word no, okay? This is also a reserved word in Python.

And if I say "not five," for example, it's of course going to return false. All right? But if I say "not false," what does "not false" mean? It means "true." Let's run this. Notice it returns true. If I change this to not true, then of course it's going to return false, all right? So I can put a not before anything, and it would do the opposite. It would convert it to the opposite boolean. So, for example, in parentheses, if I have the expression "five equals five," We now know that this evaluates to true, but because we don't have any, it will result in a false. So let's get this party started. Notice that it returns false. So not is used to get the opposite of the Boolean value. Now, all of these expressions that we are covering right now could be assigned to a variable. So if I take this, let me cut it out and assign it to some variable. Let's call it a condition. It doesn't really matter what you call it. I can conditionally assign this expression. And now, conditionally, it's going to be, first of all, a Boolean data type, right? I can print the condition. It's going to give us the same result. Let's hit the ground running. It's going to return false. However, if I perform a type function on condition to determine its type, it is, of course, a Boolean. So let's get this party started. Notice it says "pool." So all of these comparison operators and logical operators that we're exploring result in a Boolean value, either true or false. And these are paramount for controlling the flow of your programme and the various decisions your programme will need to make as it runs. And you would have to programme those decisions using these kinds of conditional operators or comparison operators. And, as I just demonstrated, you can chain these types of comparisons using and or as well as both.

So practise with this. Try to make your own conditions, run them on your own, and prepare yourself because there's going to be a quiz on this subject, and I'm going to make that a challenging quiz, all right? So that you get enough practice, take your time and struggle through this section until you fully understand where the and the or come into play and how that affects the various values. And always surround your conditions—these comparisons in parentheses and what you want evaluated together—with parentheses. I can't stress that enough, even though you can get away with not having these. If I remove these, it will give me the same result. But if I add an and here, and then I add an and here with some conditions, and then I have another and then another, or things get really, really hairy, and let's say that I wanted this entire thing to be evaluated together, right? It would just be a mess to parse that code in your head while you read it. It might still work without the parentheses, and you don't want someone else reviewing your code and going through that nightmare. Now, obviously, you shouldn't have all of these and ors in one expression like this; that's just a sign of bad code. However, if you have two or three checks running in a comparison like this, make sure to include the parentheses so that the logic is clear to anyone reviewing it.

8. Section 2 Assignments

Remember to sort the newlist. After this line runs, all of the numbers will be sorted in an ascending fashion from small to large. And remember how I said the tuple had to be sorted? So we are first converting this data into a list, and then we are sorting the list. And now what we have to do is create a new tuple, and then we assign this tuple the data of the new list. So there's a new list. Now, since it's sorted, we can just access the first element of the new list. Then we can access the second element in the new list, and then we can access the third element in the new list. And so now we have this new tuple, which we can assign back inside the original list where it belongs. As a result, we could add to the original list. But first, remember, we have to pop the last item, don't we? So we put that item in.

We don't need to save that item in anything. You could choose to save it. Remember, pop returns a value, so you can save it. But I don't care to save the tuple anywhere. I'll just add the new tuple dot append to the original list. And what are we appending? We're attending the new queue, and then we can print the original list. So let's rerun this oops. You want to make sure you don't just press play up here. I keep forgetting to right-click this file and select run assignment three. And with any luck, we should have this working correctly. Notice the cup, cereal, and milk. And then these numbers are in fact sorted, and they are in fact inside a tuple. Pretty cool, right? So hopefully you were able to work on this and figure it out on your own. If not, don't worry; there are going to be plenty more opportunities for you to practice. If you didn't get this problem, don't worry; come back to it maybe tomorrow. And before watching the solution, try this out on your own. By then, hopefully you will have forgotten some of this. And at that time, you'll get the opportunity again to exercise your muscles and your brain to work this out again.

Okay? And that's really the best way to learn. You forget, and then you practice, and you learn again. You keep forgetting what you learn, but after a couple of days of doing the same thing, repetition, repetition, repetition, you'll have it mastered. Okay, so let's move on to assignment four. And here it says, in the list shown below, to replace the letter M with the letter X and the word TV with the word television. Then print my list. So this should be relatively straightforward. Why don't you try this out, and then you can resume watching my solution? Okay, welcome back. Hopefully that wasn't too challenging at all. We've got him right here. So that needs to be replaced with the letter X, and the TV is right here. This needs to be replaced with the letter X. So what we need to do is re-access my list at the second index position because, remember, this is zero-one, two, and this tuple, this entire tuple, is at the third position, which is the index position two. And once we have identified that, we can get the first item in the tuple. And that's this thing right here, this list. So we can do that using the zero. And then we access the third item, or the fourth item here, which is M, the last item. So all we have to do is put a three right here. So the 0123 will allow us to access that M. And I'm going to assign it. I'm going to assign M with the letter X, and this will replace M with the letter X. Take note that we are now inside a tuple. OK, why are we able to change this M to an X? Remember, tuples are immutable. Why are we able to do it?

Because this list can be modified within a tuple. But if you try to assign this position in the tuple to a brand new list, it's not going to work. Okay? So inside of this list, we have the freedom to change these values around, but you cannot change this entire list, meaning you cannot assign a new list to this position in the tuple. The same thing goes for this list. Four, no matter what you do, you will not be able to change because that is part of the tutle. So we change my list at that position, assign it the value X, and then we also have to change the television. This is much simpler. We do my list, and at the index position, let's count it 0123. At index position three, we can change it to the word television. And then let's just print my list and right-click to run assignment four. And there we go. Notice how television has evolved. And notice the M has been changed to an X. So again, inside of Tuples, if you have other collection structures such as lists, remember that lists can be modified, right? So inside of this list, we can do things; we can change things around. As a matter of fact, you can also append to this list. Let's go over how we would do that. So at this particular position, we're referring to this given list. And if I were to append, we would be able to append a value. Now, notice that our editor ID is not smart enough to know that this is in fact a list that is inside of the tuple, which is inside of another list. It doesn't go that far. That's why the IntelliSense didn't automatically suggest the append method here.

Okay? But we have access to this method because we are referring to that list right here. And I'm going to append the letter Y to it, and then you'll be able to see. Let's run it. Notice the new value of Y has been added to the list, OK? because, again, lists are changeable. But if I try to assign at this position a new list like that, it's going to complain because you cannot change items entirely inside of a tuple. So that's one of these, and boom. Notice it says tuple objects do not support item assignment. We are trying to assign a new item to this position. We cannot do that in Tuples. All right, so hopefully this was a great review, and you've got an opportunity to practice everything that we've learned about so far in this section, and hopefully you're able to complete these assignments. And for now, these assignments are really just a couple of lines of code. And I'm keeping it simple as we build the blocks that are going to be needed for a strong foundation as we proceed in this course. Okay?

Python Institute PCAP practice test questions and answers, training course, study guide are uploaded in ETE Files format by real users. Study and Pass PCAP Certified Associate in Python Programming certification exam dumps & practice test questions and answers are to help students.

Run ETE Files with Vumingo Exam Testing Engine
exam-8
cert-33

Comments * The most recent comment are at the top

bradley
United States
Apr 04, 2024
@john, these pcap practice questions and answers won’t take a lot of time. just take at least 3 hours every day for the remaining days and you won’t have a difficulty in completing all the questions. try your best dude..exams need proper preparation,you know :)
glen00
Ireland
Mar 25, 2024
@john, there’s nothing to worry about comrade! just download the ete simulator to help you open these free of charge Python Institute PCAP ete files and take your tests in a similar way with that of the main exam! i tried this simulator! it’s AWESOME for practicing! you’ll manage to prepare within a short time and get all the concepts on your fingertips
john
Canada
Mar 11, 2024
hey guys,,, i feel that time is so short to go through all these pcap exam dumps… what can be best to use in such moment??????
j_lewwis
New Zealand
Mar 01, 2024
woooow)))) full of emotions!! this is really incredible…the actual exam seemed to be a repetition of what I’d already completed in those free python institute pcap practice tests… it gave an easy time as the only thing I had to do was to supply appropriate answers. ))))
Craig_76
Spain
Feb 18, 2024
it’s so cooool that i already know prepaway. these PCAP questions and answers give a perfect view of how the main exam can be set… i’ll never stop visiting this platform for good materials. good job, prepway!
it_bob
Singapore
Feb 04, 2024
hi! i now have a solid understanding of the main topics after going through these free pcap dumps … i’m very confident to face the actual exam! hope it will work well!!
Nilanka
Unknown country
Jan 22, 2024
After bought this file for $49.99 , we can do only 73 questions or more than that.

*Read comments on Python Institute PCAP certification dumps by other users. Post your comments about ETE files for Python Institute PCAP practice test questions and answers.

Add Comments

insert code
Type the characters from the picture.