My previous post about Python was in Russian, so I've decided to use English this time. So now I am a certified Python developer, and can criticize it with a full authority :) https://verify.openedg.org/?id=gDyd.T5kn.rsXA (I will say a couple of words how I've got it at the end). Last time I've made a big mistake, claiming that Python has no Boolean type. In fact, there is one. But other things are remaining. Still, I am not claiming that Python is a bad programming language. Its just not the most logical one, and can be annoying and uncomfortable to work with in general. One of the most important data types in Python is list. At first, I was thinking of it as of castrated arrays, where you have a limited way to operate with them and no freedom with indexes. But while I was advancing, I've realized, that it is a specific data type, with its own advances over the conventional arrays. However, even accepting that it is not an array, there is still a lot of annoying things about lists. You are always calling an element of a list by its number. And numbering is started from 0 (which is logical). But if you are using a range to address the list or go over its elements, the last will be not the one you are typing, but a previous one. If you have a list of 3 elements, you need to address it as list0:3. Against the logic, it will be not 0;1;2;3, but 0;1;2. You always need to remember that. If you take range(2), it will return 2 elements, but 0 and 1, not 1 and 2. What if you want to have your own list, which is started from 1, not 0? Well, you can't just set it, but you can delete element 0 (just as any element). But remember, that the default addressing is still assumes that for the list of n elements you are going through 0 to n-1. But the fun with the lists is almost endless. The second aspect is addressing. Normally, a variable name is a pointer to a certain memory area. But list in Python is a pointer to a pointer! It works like that: if you have list1=1, 2, 3, then create list2=list1, then you will get not an identical list, but a new pointer to the same one! Note, that the singular variables in Python are not working like that. Any changes of list1 automatically applied to list2 and the other way. Another thing is multidimensional list. Can you have them like that, like normal arrays? Yes. But you can't invoke a multidimensional list, you need to assign a nested list to each element individually. Which leads us to the syntax. There is a specific syntax to create a list. Like lst=list(x for x in range(3)). But this syntax for a list specific "for" is different form a normal "for" invocation! You need to remember it specifically for lists. Ok, but how many syntax variations there are? Or, more precisely, how many default ways to work with a list? Well, you can work with a list like with a normal variable, using a specific to the lists square brackets (list1=1, 2, 3). You can apply a built in function, like del list10. How will you add a new element, is there another built in function. Nope, you'll need to invoke a list specific method, like list1.append(4). And, of course, you'll have a list specific nested "for" loop. So many different ways, why you can't do it the same manner, like, always to invoke a method? Well, it's just a Python way. Apart of lists, Python has other multivalue data structures, like tuples and dictionaries. Dictionaries may have varchar indexes, and tuples are like lists, but immutable: you can't change them after creation. Even though they are quite similar, there are differences in syntax for each of them. Looks like there was a stupid solution to oversimplify a conventional array, which lead to workarounds and more workarounds. A real spaghettis bowl of a programming language. But enough for now. Now I'll tell about my certification. The Python institute is a most acclaimed authority for a Python, and it offers a multi level certification. PCEP is the first level. There are 2 free courses, which are recommended by a certification authority. I've chose a course by CISCO. Even though it has some minor errors in examples, I can recommend this one. It is a well balanced course with some practical tasks, which you can take in just 20 hours. For me it took about 15, but I have a significant programming background. I believe, this course can be taken by a complete novice, but it may be a bit more challenging. However, even if you are an expert programmer, my advice is not to skip any boring practical tasks or the basic things you already know, because it will help you to feel the Python in all its glory (and misery). To my experience, this course is completely enough to pass PCEP certification, all necessary questions are covered. In addition, I've paid for a trial test on Myexamcloud. The tests are ok (though I've found 2-3 errors in them), but they are covering a bit more than PCEP course (and, according to my experience, more, than an official exam). I did not paid for nothing, those tests were quite educational. But they almost did not contributed in my exam success. For an exam itself, there are options to buy some trial tests or a bundle with a retake on a discounted price. I was feeling myself quite confident, so I've bought the cheapest option - a single try, and it was enough for me to pass.

Теги других блогов: Python Programming Language Data Types