EuroSciPy 2017: Python (1/2)
This is a modal window.
Das Video konnte nicht geladen werden, da entweder ein Server- oder Netzwerkfehler auftrat oder das Format nicht unterstützt wird.
Formale Metadaten
Titel |
| |
Serientitel | ||
Anzahl der Teile | 43 | |
Autor | ||
Mitwirkende | ||
Lizenz | CC-Namensnennung 3.0 Unported: Sie dürfen das Werk bzw. den Inhalt zu jedem legalen Zweck nutzen, verändern und in unveränderter oder veränderter Form vervielfältigen, verbreiten und öffentlich zugänglich machen, sofern Sie den Namen des Autors/Rechteinhabers in der von ihm festgelegten Weise nennen. | |
Identifikatoren | 10.5446/38202 (DOI) | |
Herausgeber | ||
Erscheinungsjahr | ||
Sprache | ||
Produktionsort | Erlangen, Germany |
Inhaltliche Metadaten
Fachgebiet | |
Genre |
4
5
6
7
9
10
11
14
28
29
32
33
34
35
38
39
41
43
00:00
UnendlichkeitFlächeninhaltWellenpaketDämpfungInstallation <Informatik>NeuroinformatikWeb-SeiteHypermediaRechter WinkelMultiplikationsoperatorComputeranimationVorlesung/Konferenz
01:55
CodeFunktion <Mathematik>DokumentenserverGoogolNotebook-ComputerRankingCOMSpezialrechnerMAPSoftwareentwicklerFlächeninhaltSoundverarbeitungAdditionMathematikSelbst organisierendes SystemKonfiguration <Informatik>Computeranimation
03:12
TypentheorieMessage-PassingKontrollstrukturGruppoidCodeMAPService providerWeb SiteElektronische PublikationOperations ResearchBitTopologieFlächeninhaltCASE <Informatik>Nichtlineares GleichungssystemParallele SchnittstelleGruppenoperationMultiplikationsoperatorBildgebendes VerfahrenVerknüpfungsgliedEntscheidungstheorieSchlussregelNormalvektorTypentheorieMailing-ListeNotebook-ComputerSelbst organisierendes SystemProgrammierungPunktComputeranimation
06:05
Elektronische PublikationATMObjekt <Kategorie>Weg <Topologie>Elektronischer FingerabdruckInklusion <Mathematik>Ein-AusgabeNotebook-ComputerKernel <Informatik>ProgrammbibliothekMessage-PassingFunktion <Mathematik>VerzeichnisdienstToken-RingServerInterrupt <Informatik>Jensen-MaßMaßerweiterungSpeicherabzugDichte <Stochastik>BimodulURLGruppenoperationTypentheorieGanze ZahlVersionsverwaltungFirefox <Programm>TermInzidenzalgebraHypermediaMaschinenschreibenp-BlockURLSchlussregelRadikal <Mathematik>SpielkonsoleGruppenoperationTypentheorieSichtenkonzeptKonfiguration <Informatik>BitrateProgramm/QuellcodeComputeranimation
07:50
MenütechnikFirefox <Programm>TypentheorieAtomarität <Informatik>Termp-BlockFunktion <Mathematik>BetafunktionDatentypRegulärer GraphDefaultJust-in-Time-CompilerGanze ZahlKernel <Informatik>Zellularer AutomatGeradeInformationIndexberechnungKrümmungsmaßIntelGleitkommarechnungWidgetBimodulElektronische PublikationKomplex <Algebra>SystemaufrufKontextbezogenes SystemVererbungshierarchieFlächeninhaltQuick-SortDigitale PhotographieZentrische StreckungSchlussregelDivergente ReiheVersionsverwaltungHook <Programmierung>ZahlenbereichNeuroinformatikHMS <Fertigung>Rechter WinkelMultiplikationsoperatorZeitzoneQuantenzustandBAYESKreisflächePhysikalische TheoriePhysikalisches SystemAbstimmung <Frequenz>VariableHalbleiterspeicherPrototypingDatenfeldDämpfungReelle ZahlQuellcodeProgrammierungFontFormale SpracheSystem FLaufzeitfehlerGüte der AnpassungCASE <Informatik>TypentheorieNichtlinearer OperatorGanze ZahlBildschirmfensterResultantePunktMultiplikationUmsetzung <Informatik>Radikal <Mathematik>Notebook-ComputerPaarvergleichBoolesche AlgebraKonvexe MengeKomplexe EbeneInhalt <Mathematik>BitInnerer PunktComputeranimation
17:42
DatentypTypentheorieFirefox <Programm>DefaultZellularer AutomatRundungDivisionZeichenketteHochdruckGeradeElektronische PublikationSystemaufrufJust-in-Time-CompilerWidgetSchwimmkörperInnerer PunktObjekt <Kategorie>DifferenzkernEindringerkennungOrdnung <Mathematik>ZahlenbereichDifferenteHochdruckFunktionalRadikal <Mathematik>MereologieDivisionPunktDerivation <Algebra>AggregatzustandAbgeschlossene MengeVersionsverwaltungObjektorientierte ProgrammierspracheDatenkompressionPlotterZeichenketteTypentheorieGanze ZahlUnrundheitCASE <Informatik>Total <Mathematik>CodeRundungInstantiierungDämpfungPaarvergleichVideokonferenzMinkowski-MetrikRechenwerkBenutzerfreundlichkeitSpieltheorieOrtsoperatorDigitale PhotographieFlächeninhaltZeitzoneGebäude <Mathematik>Gewicht <Ausgleichsrechnung>MultiplikationsoperatorMathematikPhysikalisches SystemMomentenproblemGüte der AnpassungComputeranimation
27:07
DefaultTypentheorieDatentypRundungHochdruckZeichenketteSchwimmkörperZellularer AutomatKernel <Informatik>WidgetFirefox <Programm>TermGeradeElektronische PublikationJust-in-Time-CompilerKontrollstrukturBimodulSystemaufrufGanze ZahlIndexberechnungPartitionsfunktionDateiformatQuick-SortFlächeninhaltBitrateDivergente ReiheBildverstehenVersionsverwaltungVerkehrsinformationAutomatische IndexierungAggregatzustandZahlenbereichMaschinenschreibenARM <Computerarchitektur>Einfacher RingMathematikKurvenanpassungPunktSchlussregelMomentenproblemGüte der AnpassungResultanteZeichenketteHeegaard-ZerlegungDickeMereologieFunktionalMailing-ListeTermCASE <Informatik>Mathematische LogikFehlermeldungElement <Gruppentheorie>Einfache GenauigkeitObjekt <Kategorie>Dreiecksfreier GraphDifferenteKonditionszahlErschütterungGeradeQuantisierung <Physik>Kette <Mathematik>TypentheoriePoisson-KlammerBefehl <Informatik>MAPMultiplikationsoperatorComputeranimation
34:40
DefaultInteraktives FernsehenDatentypInformationDezimalzahlZählenPartitionsfunktionDateiformatIndexberechnungZeichenketteNichtlinearer OperatorGanze ZahlTypentheorieFirefox <Programm>Kernel <Informatik>Zellularer AutomatATMAdditionGeradeNotebook-ComputerWidgetElektronische PublikationCliquenweiteFunktion <Mathematik>KonditionszahlMaßerweiterungGüte der AnpassungFlächeninhaltSondierungCASE <Informatik>DruckverlaufNichtlinearer OperatorHMS <Fertigung>FunktionalElement <Gruppentheorie>Kategorie <Mathematik>Innerer PunktInverser LimesZeichenketteMultiplikationMereologieParametersystemOrtsoperatorDickeAdditionSchlussregelObjekt <Kategorie>TypentheorieOrdnung <Mathematik>InstantiierungPaarvergleichWort <Informatik>GruppenoperationPhysikalische TheorieFreewareArithmetisches MittelRechenwerkBasis <Mathematik>Vorzeichen <Mathematik>SpieltheorieMetropolitan area networkNatürliche ZahlAbgeschlossene MengeVerschlingungBitResultanteNichtlineares GleichungssystemEuler-WinkelInternetworkingMaschinenschreibenBAYESMinkowski-MetrikInformationBetafunktionBitratePhysikalismusComputeranimation
44:04
DatentypPartitionsfunktionIndexberechnungDateiformatDefaultTermWidgetSchwimmkörperRundungGeradeZeichenketteKernel <Informatik>Zellularer AutomatTypentheorieFirefox <Programm>OrtsoperatorBootenFunktion <Mathematik>HilfesystemMereologieElement <Gruppentheorie>BimodulElektronische PublikationSystemaufrufMultitaskingTypentheorieSchwellwertverfahrenMAPBitProgram SlicingFunktionalHilfesystemDickeMathematikCookie <Internet>Element <Gruppentheorie>MultiplikationsoperatorSchnittmengeDemo <Programm>ZahlenbereichMinkowski-MetrikVersionsverwaltungZeichenketteWort <Informatik>Prozess <Informatik>AlgorithmusOrdnung <Mathematik>Lesen <Datenverarbeitung>Basis <Mathematik>ComputerspielSerielle SchnittstelleAssoziativgesetzVererbungshierarchieFlächeninhaltGüte der AnpassungRechter WinkelFamilie <Mathematik>SpieltheorieQuantenzustandEreignishorizontAbstimmung <Frequenz>Formation <Mathematik>PhasenumwandlungGewicht <Ausgleichsrechnung>Nichtlinearer OperatorDatensatzBitrateSchlüsselverwaltungCASE <Informatik>Computeranimation
52:24
DatentypMultitaskingDefaultTermFirefox <Programm>TypentheorieKernel <Informatik>Zellularer AutomatMailing-ListeHilfesystemBimodulElement <Gruppentheorie>GarbentheorieKrümmungsmaßMailing-ListeProgram SlicingCodeAutomatische IndexierungElektronischer ProgrammführerTextur-MappingTopologieElement <Gruppentheorie>GraphiktablettDreiMultiplikationsoperatorPoisson-KlammerMaßerweiterungZahlenbereichDickeForcingMathematikDruckverlaufZeichenketteDimensionsanalysePunktResultanteFlächeninhaltShape <Informatik>CodecSichtenkonzeptGradientSoundverarbeitungEinfacher RingSpieltheorieFormation <Mathematik>WasserdampftafelWort <Informatik>Kategorie <Mathematik>Einhängung <Mathematik>Güte der Anpassungt-TestOrtsoperatorOrdnung <Mathematik>EnergiedichteComputeranimation
01:00:43
DefaultZellularer AutomatKernel <Informatik>Firefox <Programm>TypentheorieHilfesystemElement <Gruppentheorie>GarbentheorieMultitaskingBimodulZählenIndexberechnungUmwandlungsenthalpieMatrixinversionZeichenketteGebäude <Mathematik>CASE <Informatik>GamecontrollerAdditionOffice-PaketMathematikDatenmissbrauchFlächeninhaltDruckverlaufART-NetzMetropolitan area networkDreiecksfreier GraphDifferentePhasenumwandlungWellenpaketResultanteVollständiger VerbandBildverstehenSystem FEinsGeradePhysikalische TheorieFehlermeldungVideokonferenzInhalt <Mathematik>AnnulatorShape <Informatik>ZahlenbereichGüte der AnpassungAutomatische IndexierungMailing-ListeElement <Gruppentheorie>Rechter WinkelForcingDickeTouchscreenParametersystemFunktionalMultiplikationsoperatorEin-AusgabeSchnittmengeZeichenketteQuick-SortOrtsoperatorFormale SpracheTypentheorieWinkelDifferenzkernComputeranimation
01:09:03
Zellularer AutomatPartitionsfunktionIndexberechnungDateiformatZeichenketteTypentheorieFirefox <Programm>DefaultKernel <Informatik>TermMaßerweiterungFunktion <Mathematik>HilfesystemQuick-SortHill-DifferentialgleichungWidgetBimodulElektronische PublikationGeradeSystemaufrufEreignishorizontSoundverarbeitungVollständiger VerbandIntelligentes NetzBetragsflächeBridge <Kommunikationstechnik>ComputerspielVersionsverwaltungSchlussregelCASE <Informatik>Prozess <Informatik>Schreib-Lese-KopfResultanteInnerer PunktElement <Gruppentheorie>ZeichenketteMailing-ListeZahlenbereichExogene VariableGanze ZahlMultiplikationsoperatorPunktMathematikPaarvergleichTypentheorieFunktionalHalbleiterspeicherNichtlinearer OperatorMomentenproblemProgrammierungMultiplikationComputeranimation
01:17:23
DefaultKernel <Informatik>Quick-SortZellularer AutomatTypentheorieFirefox <Programm>MathematikHilfesystemTupelWidgetDatentypElektronische PublikationBimodulGeradeSystemaufrufParallele SchnittstelleJust-in-Time-CompilerBefehl <Informatik>ResultanteMomentenproblemPhysikalische TheorieRechenwerkStützpunkt <Mathematik>TabelleSoundverarbeitungFlächeninhaltVererbungshierarchieVerschlingungWellenpaketBildverstehenPhysikalisches SystemKonditionszahlMultiplikationsoperatorZahlenbereichARM <Computerarchitektur>BitrateSichtenkonzeptSpeicherabzugZeichenketteMAPZweiMailing-ListeElement <Gruppentheorie>Automatische IndexierungTupelInstantiierungExogene VariableFunktionalTypentheorieMathematikDifferenteMathematische LogikÄhnlichkeitsgeometrieFolge <Mathematik>GeradeCASE <Informatik>ParametersystemVariableComputeranimation
01:23:48
GeradeElektronische PublikationSystemaufrufBimodulTypentheorieFirefox <Programm>DefaultZellularer AutomatKernel <Informatik>SchnittmengeHilfesystemWidgetIndexberechnungDatentypJust-in-Time-CompilerZeichenketteKommandospracheSchlüsselverwaltungTypentheoriePoisson-KlammerSchlüsselverwaltungPunktElement <Gruppentheorie>Mapping <Computergraphik>WhiteboardKlasse <Mathematik>ZahlenbereichSchnittmengeWort <Informatik>UmwandlungsenthalpieFehlermeldungPersönliche IdentifikationsnummerDifferenteInstantiierungMultiplikationsoperatorFunktionalData DictionaryNichtlinearer OperatorMixed RealityFlächeninhaltOrdnung <Mathematik>MAPVerknüpfungsgliedBildverstehenGüte der AnpassungViewerBildgebendes VerfahrenComputeranimation
01:29:47
TypentheorieFirefox <Programm>DefaultPerfekte GruppeKontrollstrukturMultiplikationsoperatorComputeranimation
Transkript: Englisch(automatisch erzeugt)
00:15
So, this is Python 1.0.0 and 1.1.0.1 that there is a basis, so if you run, you run
00:21
some like training step in Python, it's going to be based to run in Python, so we start from scratch. And the first thing that I will need from you is to use that Python, so there's already a Python, does anybody have a Python stack? One, two, okay, so if you need Python, what I can ask you is to go in the middle
00:44
of the page and then you can install one of those, so in the current Python 3.6 you can select one of the installers and you can follow the install path.
01:02
One of the things that we'll do also is, I will pass this, you can take one, then I have to do one also, which is at the back of the room there. And if you need anything, so we'll do two, so I'll try to manage from here, but then if you need something, you said to put your hands up, alright, like that,
01:20
you can speed this under the front of your computer and you can continue doing something if you have questions and you will turn around or I will turn around depending on how you're doing it, okay, that's nobody to sustain hands, okay? So you can take one and make it fast.
02:05
Can I just try to switch the light off to see if it's there? Is it better? Better with the light or without the light? It doesn't change much.
02:25
So, then we work with some network, and I saw some light coming in from there. Regarding the network, you can find them on my people, so I can show you how to do that.
02:41
So you can go in here, and you can find me if you want.
03:01
Is Tony or people can tell you? Okay, great. Because the idea was that you can go there.
03:43
Do you have a job? No, I don't have a job, but I mean, it doesn't hurt, but I'll be helping you out.
04:29
So, what we can do is just show the network, and then we write light programming, or programming syntax, or we do one by one if we cannot download them, okay?
04:41
If at some point we get internet, that would be good. So, anyway, if you come back to GitHub, you will have these people, and then you have a list of notebooks. I know if you have time, you can do everything with it, and then you have the solution, which will be more than this, okay?
05:01
So, when you go back home, if you want to go back, you will always be able to do that. So, does anybody has a GPTI notebook? This guy? Oh, who doesn't have this thing started? I didn't know that that thing started.
05:23
Okay. So, you can see that I cannot just install. Anything will break. Is it all working? At the beginning, we didn't need solution. It just gives you to do things first. Then I need to know who is working on Windows, Linux, and Mac AC.
05:55
So, the first thing that we start to work with is the basic types of Python.
06:01
Can you go back? So, you didn't have access from the organizers.
06:30
So, people get a Wi-Fi blockchain that is around noon, and until then, there is the HTML block. If you have just forged it in your mobile phone,
06:43
then you have the URL that is the working feed that you have. So, if you have them, then it's... Yeah, so, it's working because the URL is dead, so... Okay. So, you will get access to the data, and this morning, you can just manage this mobile phone access.
07:05
And one person can sell Wi-Fi for several people by using Gucci. So, if you can just manage also with the papers. So, you can do this. Anyway, here, you know. I mean, if you have Python, then you don't need it. We managed with the console.
07:22
So, for all of you that start, does anybody know how to start the Python terminal? So, when you start, it's usually in the Conda app, you install it somewhere, and then you should be able to start the Python terminal. So, in minutes. Only thing that you have to do is type Python, and then start with something.
07:42
So, in groups.
08:23
You should have those information. So, if you don't get there, you should not just put that in the start. So, is anybody existing to run Python terminal in Windows 9? So, if somebody up-frames us with an answer, we will start from there.
08:41
It's fine. Python 2.7, does it matter? Since that's the golden internet, it will not matter, but it will be a good use case for the things that are working on Python, and the one things we can really expand. Okay? Anybody else? We can start. Okay.
09:00
So, usually in your notebook, what's happening is that, underneath, you have a Python, like this one, that is starting, and then, whatever you write inside the command, and when you read the index, it's sending to the kernel, exits it, and puts you, the results, back inside here. So, it's an iterative minus,
09:21
so it's what the notebook is. Okay? Just to explain you, if you go back on the notebook, what actually is happening? So, what we do now is that everybody will have a Python terminal pressure, but maybe not the notebook, we work it in the terminal, and we just execute by hand this inside
09:40
the terminal. Okay? So, the first thing that I want to introduce is the runtime that we're in Python. So, I will have maybe 20 minutes, or maybe only 15, where we present you a couple of things, and then you will have to, I mean, I will give you some exercise, like this will be more interactive to do stuff.
10:03
So, the first thing that I want to present is a newer type in Python. So, before it starts, we will already program in one language. Program in one language? Everyone? No? Did you ever program in Python, for instance? Yes?
10:22
There is some secrets with parameters? R, maybe? Okay. Okay, I see. So, Can you increase the fonts of the notebook?
10:40
Yeah, I see. So, you have many, yeah, that's not a real source field. You have many prototypes in Python? Oh, for example.
11:04
So, the first time that you have this in there, so I think that you insert this in, and then you declare your variables. And in Python, so you don't have types, so the only way that you can create an integer is that you put an integer inside the human type,
11:20
and if you want to check the type, you can use the command type, and then it will tell you which type of things it is. So, for example, if we take the integer 5, and we add the type, it will tell us it's an integer. Okay.
11:41
Then, this, I think that you really know, so you can put it inside your papers, using paper, and you can make operations, for instance, animations, and if you still check the type of i inside case, you will start finding bigger things. Okay, then,
12:00
you can update it. So, for the one that works in C++, similarly, or you can have memory and all those things, it will be interesting to know that the ints in Python are actually on 32 bits. Okay, I give you this information. It's more interesting for the tools afterwards.
12:20
So, in the same way, if you go in the NumPy tomorrow, I think, it's tomorrow, or maybe in afternoon. So maybe you don't have NumPy, but we can play out some of the accuracy of all the integers. So, here, it's just to explain why it's called 32 bits,
12:40
so when you use your Python, it will be only 32 bits, every time 32 bits, it's integers. And when you use NumPy, so, for instance, I'm doing NumPy, I can have access to different integer types. So, for instance,
13:02
16, 32, 64, and 8, and then it will use the precisions of the integers. So, for instance, I could use 8 bits integers, and i, and checking the type of i, in my case, you will have these integers, too.
13:22
So, you will never mess up between the types, or if you don't know, you just use the comma type, and you will take away the things. So, why is it important that if I only take this, I can only put 255 values, so if I do 256,
13:41
and I check the value of i, then you get something which is weird, because I have a number probe, I can only have this, the content value, and, but you have this one, okay? So, you can prove what type is underneath it, is it a NumPy, or is it a Python type? So, this is something which is interesting. Then we have about the same thing with probes.
14:01
So, how to free your probes. In Python, it's pretty easy, you have to optimize the point, and this means, is a probe. Okay? Probes, in Python are only 64 bits. And, in the same manners,
14:21
you have NumPy types, types, you can check, and type probes. We have 128, 16, 32, so you can prove the precision. So, it's working in the same way. Okay? Then there's the integers. And, if you place one of them,
14:50
you have the same thing that happened. Then, the next type that you're going to have, so maybe you've got positions,
15:01
and like, with convex numbers, so I don't remember, I wanted it in my time, I think that it is i. And here, it is in the same, that is, 1g. So, you don't, you are always to put something at the top.
15:22
you have the convex number, and that is 1. Today, this thing is recognized as the convex number. So, then I can trace a number by, I mean, the linear part, the
15:43
imaginary part. Okay? And it will handle everything inside. And then you can also multiply both and each of the values.
16:06
Then, the last type, which is also interesting, is the Boolean. So, we always make, I mean, we usually make random operations. So, you can check using bigger, smaller, and you have two values,
16:20
which are 2, and 4. This time by a capital letters, and that only means that you have to move all the integers. Okay? So, whenever you make a comparison, you will get one of those two out of the comparisons. Okay? So, now, a couple of comparisons
16:41
that you can do, and that is more interesting. So, we spoke about, like, the precisions and the different types. So, what you are thinking, by thinking that you have no types, you have to think about what will be the implied conversions when you use operations. if I take two integers, and I take two multiplications, so
17:00
I didn't have a point, it means that if I check the type of this, I will get an integer. Okay? That's kind of obvious. But, if I do the points here, and I check the type, I get the float. So, all those are good, but quite enough. You take this one, you will convert it to a float,
17:22
this one is already a float, and you will make the multiplication between both, and return you a non-casted result. So, this is something that you have to maybe think about when you make operations. In separate spaces, you can have that program, you always define the type, and you know what's what. Here, you have to think what will happen. Okay?
17:43
Then, that will be the good part. This is what people in Python do. So, if I do the divisions in Python 3, I get that. So, now, can you try to make a division, then it's going to be okay when you do this? Zero.
18:02
Okay, great. So, if you don't have the same Python, it doesn't work the same way. The idea is that in two cases, in Python 2, when you are making these divisions, you are doing the integer division. So, I have an integer, I have another one of our I will return you the from of the two divisions. So, I will return you zero.
18:22
If I want to do that in Python 4, or in Python 3, stick, I use the number division. Okay? So, now, Python 2 and Python 3 are the same, because what we do is we try to move from Python 2 to Python 3 and that everything
18:40
is located in the same both ways again. So, yes, the library, which is called DOM features, which is you will import how the step might work in Python 3. Import divisions.
19:02
And now, you can retry, after importing these, to do the same compression as this one. And then it works. So, when you make some code, and then you want to make it compatible to three, you have actually two things to import. Here is one, which is this one. And then, I will show another one.
19:21
Now, is a print. So, sometimes you want to print something inside the terminal and you just use the function print. Oops. And I do that. Okay? In Python 2 you could do a step name. So, you mean that you didn't need to
19:40
do part of this. Here is the function because I did part of this. So, you are going to do that. Which, here doesn't work because in Python 3 print is a function. Okay? So, the same way, which is, also, you can upload it. You can use
20:00
Python 3 versions by doing from feature import print. And if you do that, now, whatever, when you try to do these things in Python 2, it will raise the same norm. So, you will be obliged to use the function type.
20:20
Okay? So, and now, does anybody have a question? I mean, that's, that's okay. Yeah? Another fun question. Do you have, should I close it? Ah, of course you might. I have no idea. You have a few.
20:41
Okay. Just as a promise. So, yeah, otherwise, so we can come back to the divisions. So now, that was giving
21:01
a float. Before in Python 2, if you wanted to trigger a float, you would have a way because we said that actually, you would have a function under the wood. And one way was to say that, why the derivatives were closed. So I could use this and for sure it would work.
21:22
I would advise you just to use the from import features. I mean, the import function, import state divisions. And, to actually use what you would be doing in Python 3. Okay? That's, it's already by the point and then you don't have the function in which
21:40
you know what it is. I think it's important to note that you only need this when you're writing code for both Python 2 and Python 3. Where you want to compare between Python 2 and Python 3. You want the user using a different Python tool and user using that tool with different Python tools.
22:07
Okay? So next things that I will go through is the comparisons. So, you can compare an order together so we really saw that it would give you something there.
22:21
So, you can compare that to what is equal equal to one. And, we can make superior, superior or equal. And then there is there is a number of things in Python which is the is statement. Okay?
22:40
So, the difference between equal equal and is is that is will check the IDs of the object that you work with. Okay? And it will not just check the value that you have but also check the ID. So, if I take ID one to give me
23:01
an implicit bias and when I make one is one what is it doing? Is it checking that the enough value of this guy is equal to the enough value of this other guy? So, when you go in objects you might want to check that an object
23:21
is exactly the I mean that this is the same object and you will use is and not equal equal. So, it's something to know what are the same things. So, here the one do not need it but that would be in the same software. So, for instance you have the example of
23:41
one zero is not one yeah? Because one is one is will be an integer so it will have the same ID so if I do ID of one and I check the ID of one dot zero it will have two different IDs okay?
24:00
So, the two numbers are different. So, if I do one is one dot zero it will be false but if I do one is equal to one dot zero that will be true okay? So, this one we will check that the two values are really the same this one we will check that the two objects for each of these they are the same items
24:22
okay? Then what does it mean? So, maybe we've been listening to retransform an integer into a total an integer or a string to something else or numbers and then we have a case
24:42
so this is pretty straightforward you use the functions so if you want to use the plot function and you can put an indian inside and put it on the other plot the same way you can use the integer function
25:01
and you will convert this into an integer so you have to be careful that this is making a plot if you want we send round to use the round function and and it will do what you expect okay? An interesting thing
25:21
is that you can put we'll see just afterwards the string that they anticipate imagine that you read some text and when you obtain the string so then we can create the plot numbers by passing the string into the plot and it will automatically convert it to
25:41
the plot so we can check now the type to the plot so then when you go in the log sometimes when you make portions you have a pretty fast way of implementing the string and now I'm way off working with this and and the function finds a way off okay?
26:01
sorry? you have questions? it is working okay? so round does find I do find okay here I do I never use what's the question?
26:21
in Python 2.5 you can do is this working? that is not working? it should that's been around for a while okay did you maybe tie
26:41
the class or something? on the string? that's okay so in 7
27:06
okay
27:38
I will continue
27:43
so we start about split like cycle but string so now we go in string so I will speak about container really a different type of container so what we call a container to simplify you just kind of a red where you can put right inside so a string is an array where each
28:01
on Christmas you can just put a letter okay? and then it will create a string of characters okay so in Python to do this you can just use azer the level how do you call this in English?
28:21
quotes yeah quotes and put text inside or you can use a simple quotes so the interesting part of the double quotes is that I know if you get to have inside your sentence you have a single quotes
28:41
so you can put your double quotes having your single quotes in the middle and it will be integrated as a character and if you have a single quote in the middle and that you use only single quotes you have in syntax errors because you consider that you open this and that you open another one and then
29:01
so if you want to have a single quote quotes inside you need to use double quotes okay and the other way around yeah so this is how you can analyze those things when you want to miss quotes yeah when you want to miss quotes quotes so if you
29:21
so each other the sentence concerns whatsoever so in that case I cannot use the single quotes to delineate this one because I have a single quote so I need to yeah but when you do it at the sentence you will see it
29:40
uses logic yeah so you use it so I said that the container you put zero characters
30:01
so you have two kinds of functions one which is called length which can check the length so if I have a sentence okay and that I check the
30:20
length of this and it opens the number of characters that I animate here okay you can add a new line or those type of characters just mean inside you you string through most
30:40
times like that and when you print it so if I do x and I do x like this so you see that my characters and if I use the length statement you will interpret those characters so you make
31:00
a little line here okay to access one of the characters inside this thing you can use the and you will be always the same when you want to access an element of the container
31:20
so now we work this thing you will use the square brackets like x and then here the index of the element that works do you want that for the one that comes from matlab as you know are the same we start to come from zero inside that so I can see in
31:41
the first so if you want the first characters inside zero it goes directly x okay and I get the first characters so we start with the things which are
32:00
maybe more difficult sentences are in the one which means that the thing that I had before I cannot put new things inside so it is something difficult for the strings if I try to say the first character I want to be quantity it is not possible because I
32:21
cannot change my objects okay so if you want to x is equal to the new chain of characters okay if you
32:40
will not be able to change things so now I want to start to make exercises so that you can find how those things are working and
33:00
yeah so is to use the quantum equations so what is so because x is actually an object in Python you will be able to use vibrations twice and then
33:21
it will give you always a list of what other function you are okay yes for which part that cannot you know the condition oh I think so no no it doesn't work
33:40
uh wait I need this yeah that's a bad term I'm not sure uh if you could oh
34:00
I think it was that you didn't have to find x now you can yeah it does yeah yeah that's what I think you
34:25
so for the one which are Python 2 and maybe a lot of the preparations you might be lucky if you are so let me
34:42
check yeah for I okay so it is a Python but with some extensions which you to like easy or to condition or something so sometimes it is
35:00
with anaconda and if you are Python 2 it doesn't work but it you would work in if you fine then then have the same block of pressure and it
35:21
doesn't work it can always plan and usually it is we You can switch to that in case that those operations don't work.
35:46
So when I say leading underscore, what I mean by that is that you can use these things to underscore and then use those operations. And now we will see that those functions are things which are part of the objects in Python
36:05
so that even things don't need to be used. So we are defining actually what the object can do. And for instance, we already use lengths and we see that this object has the underscore length functions which mean that actually when we call length, it will call these
36:23
functions under the rule. So by using those two functions, I can know more or less which object is leading and I know that it cannot, and I can still find out which function my object is implementing. So while we are in the middle of the world, we can still understand which type of length
36:41
and what it can do with it. So the first step I will assume is that, okay, check what the multiplications, the parameters is doing, and if we check the multiplications, I will see which positions because we are very tight. So I think that we are able to use the start multiplication at some point.
37:01
If we check also, we have an addition from the engine, I think add, add something somewhere. Okay, we have an add function too, so we are able to use the rest. So now what I want is that I have this x and I want you to try to run this x
37:25
and I want you to multiply by something and try to see what's happening, okay? And in this case, try to multiply it by an integer. And then you can tell, okay, what's the operation, what does the limit try to do? So if somebody succeeds to see what's this, you can decide what you see.
37:45
So what is the purpose of multiplying the strings? Okay, so here's the thing. When you multiply by an integer, you're just repeating the string, okay? That's a property that's working.
38:01
So this is the area that's doing, doesn't make sense, right? And then when you think about it, okay, why not? Okay, so it's always good to have the, to know exactly what those operations are. So in the same way, I want you to try to make the addition and to tell me what does it does, okay?
38:21
You try to add two strings together, okay? So that's the other add, so you should have a press. In case you can exercise. And then you can tell me what this thing is doing.
38:48
Okay, so this thing is called concatenation. So if I do x, if I do x plus x, then in that case, it's like, but here,
39:07
it's adding the first x, concatenate with the second x, okay? So in this, afterwards, if we check again,
39:28
those four functions, well, they tell them, and we have some which are equal, and should have also not equal, so I need to use some more, and it will always make comparison between strings.
39:41
So if I add x, and I want to check that this is the string in values, I don't know what was inside, but if I write this, it will tell me, this is false, okay? You make a particular character shape, another shape, this will tell you this.
40:05
In the same way, you have the not equal. Which is the name, it's going to be equal. Which is going to be like this. An interesting thing is the operator in here. So in here, I'm going back here, and this is something specific to the containers.
40:26
Containers, because it contains something? Yeah, the contained functions are on the top here, and it will allow you to check that the part of the element is inside the container. So for a string, we can actually say that the string is inside, okay?
40:43
And how to do that? You write your side, and I want to check if it's in x, and you can guess, okay? So you can partially match things using the int operator.
41:07
Okay, so the two things that is interesting, so now we saw the equal equal function, but before we saw that you can do x and tabulations,
41:20
you have a bunch of functions which are coming, okay? So now the last side is by checking the name there, I asked you to check that inside the string, to this string, I want to check that the name of the string is finishing by something, and the second thing that I want is, I said that it's not possible to affect the characters,
41:42
but that's your function, so I want you to replace, inside the string, the letter or something like that, okay? So a letter by a letter. So now if you check inside this bunch of functions, you have two functions that do that, and then you have two minutes or five minutes to search which one are in it,
42:01
and you can try to use it, and because we are here and that could be useful or so, you can always use and check the domain, using the keyword n. So for example if I want to check what the center function is doing,
42:23
I type n, x dot center, and it will give you a dot string which explains how the thing is working. So I don't need internet in order to do it, I can do it through the terminal, so it's less nice, but again if you are new internet,
42:41
I can say connect. So now comes the x dot, you can check. If you are not sure, you can check which one you think is working, and you can change it up and try to use it, okay? And for instance if you just try to modify a character, the other one is to check that the end of the string is very something to understand.
43:03
So you can try that, and if you have any questions that you want to ask.
43:37
No, it's a little bit hard,
43:40
so you have to learn, you have a chance, and if you want to, then you can just kind of go through things, and try to use, so if I want to, I can just do this, and I'm going to write something, and then I'm going to finish. So if anything is working in the end, and you are not working in the end,
44:02
then try to figure out, how do you check the end of the string? Anybody have any questions? Okay, so why is it a function to check that the string is finishing the other one?
44:47
How do you check that the string finished by a set string? Why don't you need to find out who is doing this first? I'm with you, okay? So if you check the end of the string,
45:06
and you can check on the end of that, and you will notice how it is working. So A is how high the string is,
45:22
so when we deal with it over here, is what we are searching inside the string. Okay.
45:46
So now I can say that, for instance, the word is finishing by five, and it will tell me yes. So, you have the overweight degree, but you might think that you have the fighting name, the fighting name is easy, you want to say that you can go back to your feet. The easy way is to get the fighting name that's next to it,
46:02
and you go, okay, that's finished. Then for the replace, I didn't search so far, it's the replace function, and it's to replace the character by a number one,
46:21
so we can say that I want to replace e by the character e. And that will make your version in place, so now you can check x, nope, that doesn't make your version in place, like we've done in the results,
46:40
it's generating this version, it works. And you get now something where you replaced the character, okay? So you can change things inside. So now, I will start to,
47:04
I didn't make much sense for the spins, but I will present the space here, and we will see that we will use it afterwards in the lists, where it's much more useful. Let's start there, because it's the same content again.
47:22
You cannot do that in Python, because x is in the demo, so the spin is in the demo. So you cannot change an element in the spin in place, if you need to create a new place,
47:43
make a cookie of it, and change at a time when you construct it. So the replace function does this, it's taking the new characters, and creating a new spin, and giving back the objects, and throw them away, okay? So that's how that works. So it's not, it's immutable because you cannot change anything there.
48:02
So we'll see after that the list, it's something that you can change inside. So now we use slice. So the slice, you can change the length with the slice, but for the one who comes from,
48:21
I mean, you set the threshold like that, it's something that you already used, which is looking this syntax, okay? So it's like, I have an array, and I want to change the value from 0 to 10 by a set of 2, so you can start to play with those things, okay?
48:42
So I think that in this case, I could check, so we'll really use this, so that's x, I could check my first characters by asking 0, but I could also check from the third characters,
49:01
okay, so from 0 to this one, by putting the point, so this is start, this is stop, and I could even say that I want to go a little bit more, 2 by 2, okay?
49:22
And that's the step, okay? So you can take elements and slice them, so this is called slice. An interesting thing in Python, compared to Matlab when I was using Matlab, is that you can go backwards, so when some x minus 1 is defined,
49:42
either that I take the last characters, okay, so from the right, and I can go backwards in that syntax, okay? May I just ask you a quick question, is everyone able to follow the examples now,
50:00
or is anyone still stuck with preparation, or does anyone need help to get there, or is everyone following properly, okay? Don't be scared, you can do something good as well. Okay, so you can use minus,
50:26
and then you can slice also from the ring, we will put the hit numbers, and to go backwards also, so we can mix together, x from 0 to minus 2, and then we are going to take
50:42
from positive and this one is going to go backwards again, so you can use those. I find very convenient that you can go negative in this case, something that you cannot do everywhere. So, what I want now is that others who would explain what this is,
51:01
because this is going to be also a function, so that's the slice, so the level has to allow you to do that in Python, and you can find your help using slice, and you see that active is a function where you put the start and the end state, and maybe in your life,
51:20
sometimes it will be, even if you don't want to use the shortcuts, and you want to use the function, so I want to show you how to do it, and in that case, if you find the slice is different from the same, you can define it in that way, put it inside the variables,
51:42
and now if you change the type of SL, it will be a slice, and I can give it to, okay, and you will do the job. So now, it's the same way if your algorithm puts here 0, 2 points, minus 1,
52:01
along 2, okay? Then, if you want to escape one of them in these functions, you can use the keyword null, to say I don't have anything to give, and that would be null, and it will just use,
52:21
like, if you are escaping it, so if I do this, it will be equivalent to 0, 2 points, 0.2, okay? It's just the keyword to tell you, like, you need to put the keyword and null is, like, broken, and in the short one, it's like you don't put anything.
52:41
Okay, that very well works. Okay, so now, so, do you have any questions on the string? Now we go on the lists, so if you have something ready to use string, let's not fear, that I didn't need to change my list.
53:03
Okay? So now the list. So the list are good, so we saw string is just to put characters, lists are something where we can put anything inside, and moreover, we can mutate that, so it means that we can make in place statements,
53:22
and make, add some stuff inside, and this kind of things. So, you can have, again, the length of the list, in head, and you have punch, you have some ball, we send you all the scores,
53:41
the leading underscore function, to know where it is implemented, but, see, that's in the container, as the string, you will have some similarity, okay? And then you have changes that are just difficult to process. So, so it's working that way.
54:02
You can use the scrub bracket to define the list, okay? And now, this will be an empty list, I am looking inside, so if I check this, and I then check it, yeah, I have an empty list,
54:21
if I change the time, that's it, okay? So we can have an empty list, that's the reason that we can not. And then we can put some stuff inside, okay, so let's start to make, integrate them with the ball, and I can put one, two, three, four,
54:41
and if I change now my list, yeah, I have numbers inside, so, times will be once released, and now what I want is so that you can train with the style that we just saw before.
55:01
So, press open, try to get the first element of the list, try to get the single element from the end of the list, and then try to get the third and the fourth element of the list, okay, so that's practice, you can try to do that, okay? So if you work with it in the same way that we saw with the string,
55:21
so it's, you turn now, okay? So if you have any questions, you can do this. Try it for us.
56:24
This padding one, two, three, four, and slice, starting from one to four, are the same. So the list, start from one to three, four, and slice, starting from one, and ending from one,
56:41
ending from one, so there you have the same extension, but the same extension, and you can do the other one, the same extension. So, So the slice will not show you the middle or the middle, the way that I will do from zero to four, okay?
57:06
So that's the slice. Yeah, sure. So you said that is the same as? Yeah, so the slice is one to four, and the single element of the tree is one to three, four,
57:21
and the single element of the tree is one to three, four, and the single element of the tree is one to three, four. I wanted to get the questions, and then I'll get this one. If you can show me a little slide, please.
57:47
Okay. This is the slice. Is there a question that's very relapsing here? Yes, please. So slice, slice, the list, so when you do the slice inside, it's the list and you return the list. Okay, sure.
58:01
And I'm going to add a lot of people, because it's related to four, and you end up with more or more people. Okay.
58:23
So if you're looking at how the crunch so when I'm doing the texture i, you're going to see the two smaller And this guide is the generic one. Tell me if you can start with this code.
58:42
It is the one where you actually choose when you can do index by index and see what you get. So when you do the list, you get the result. Yeah, that's what I'm talking about. You don't need to go into the index. Yeah. So what you're going to do is,
59:03
you're going to start, you're going to start, So, the here. The one that starts, the one that finishes, you're going to take every step. Ah, okay. So, you start, cut,
59:20
and then point to step. Ah. And this you can do by you can take the length of the size, the dimension of the method. So, I take the only one. And it will be the step. And it will be more. And it starts with step.
59:41
And then it will change here. Okay, so, does anybody have any questions? I will do it, but before that, it's fine? Okay, so it means that to get to the next.
01:00:00
And this was, so here the pressure here is zero. You get the similar one from one minus two. And you get the third element, so it would be 0.2 to the force.
01:00:23
So how do you get the force in that case? Do I put four or do I put five? Three? If I put three, I get a number.
01:00:41
Only one. So it means that I got the number three. So I got only the third element. Why that? Because you could change it. And I think this is something important to remember. Maybe it's not the same as the language. This means that the stuff here is excluded.
01:01:02
So when I say two to three, you will take onto the two and you will not take the third one. So if I want to take the third one, I need to put force and it will exclude the fourth one. So I will have only two and the index two and three. So it's something to remember. Every time you multiply, you can check if the last element is included or not.
01:01:28
So if I want to have two elements, this one and now I have my two elements. So because the force will be, so it's two, index two, index three. And the force one will be included. Okay?
01:01:48
Okay, so now what I want is that we already saw that we have the length function. So I wanted to use in the same way as before this.
01:02:01
I want you to, just using the expression, find the function which comes a specific element inside the list. So for example, let's say that we want to know how many number two we have. So you can check which one you have.
01:02:20
And you can pretend you're trying to understand, because it's obvious. So, yeah, ready? And then from terms, you can ask and it's okay. So number two here have the one types.
01:02:40
And what I'm seeing now is that we can maybe append the value. So we have all this and we have the new value inside. And we'll have the new value too, just to see how our function is working.
01:03:01
I mean, it's working like what we've made a lot. So find a function inside that which makes a value. And we can add sub-width, okay? So it means that I take my list and that I want to add a new value.
01:03:23
So let's say, because I want to put a first, I put a list. And I tap under, and now that I'm checking my list, I append it and I'm going to add another list, okay?
01:03:44
So if I check my count, now I'm certain that there's two too, okay? So if you want to add a new element, keep in mind, append is one of the functions that you bring up to users, okay? There's another interesting function, which is sort.
01:04:04
So if I have a list, I can use it now just to show you. And that I add a sort function, and that I check my list. It is in place, okay? So the same is in place.
01:04:21
You want to use the parameter and the position that it should be, okay? What else do you have inside that is interesting? Pop, so pop is actually something interesting because I know you want to remove a specific thing.
01:04:50
So what I just asked now is, okay, I want to pop a print, so you check this popping print, and then if I check my list, you remove it.
01:05:01
And at the same time, you read them with the line. So for instance, you want to do inside a list and just pop numbers, okay? So you can do it. And that's getting the element, and at the same time, you're removing from your list. So then you have a bunch of functions that you can change the log string every time. We can remove inserts, and they are all different, slightly different from each other.
01:05:23
So that's something. All those functions, they are specific from the list. So we saw with the screen, at the end, we start with replace. They are specific for the screen. We need those specific functions, okay? I have a question.
01:05:41
Yeah, sure. For Apple, you have just one input argument. Yeah? Yeah. If you want to add a list, for example, to another without, for example, appends two or more than two arguments. Okay. So I know it's maybe the next question.
01:06:04
Just using appends, not add. I'm using, I mean, what you will use is you will do the computations. Okay. I mean, I only do the computations. Okay. Then, if you try, what would happen if I do that?
01:06:30
I mean, what are your, I mean, what I think it is. I don't do it. So I have this list here. What would happen if I try to add that?
01:06:41
I mean, the list, we will mistake inside that. What are you for? I mean, what would happen if I try to do that? Add the next set. Add a set. So we have one, two, two, four, five, one, two, three?
01:07:00
No, right. No, right. So what you do is that you will add, you will consider that this, this and that, and you will add it in the next piece. So if you check this, now, you add me a list inside the list. So it means already that you can make 2D lists. Okay, if you need something that's hard to read,
01:07:21
you can do something like that. And you think that if I want to access it, if I did minus one to access the last element, what you really need is a list. Okay. So at that, you append all the check inside. So if you want to add element by element,
01:07:40
what you will do is, for instance, you're going to use a classic point, which is in place i, so it's equivalent to say that plus.
01:08:02
So in that case, it's what you were wanting to do, okay? So it's with the first. So I can use either the list equal plus new things or the short things is used plus equal.
01:08:24
It's not entirely the same thing though. Because when you use plus equals, then it does in place modifications, where it changes the list. If you say in list equals in list plus something, then it actually creates a new list,
01:08:41
so it creates a copy. And it does not modify the list itself. Yeah. What about compared to this? This is the list according to the data angle. I know how you... Let's close the door.
01:09:10
I don't want you to go get it. You don't have it. Because I mean, I know how you know why I use it, so you can put it in a stack. Yeah. But here you would use for it to do that.
01:09:22
I mean, what I do is... There is an expand method though, which... Yeah, expand, yeah. Which adds multiple elements to the list. So that's kind of the end multiple operations.
01:09:51
So you can use that first. So you can give an interval, and it will integrate itself.
01:10:05
So then the next thing that is interesting with the list is that you can add any type of data inside. So you are not on... For the moment we just tried... I mean, already, 10 of these, we would integrate, but actually what we did
01:10:23
is just to put a list inside the list. But to make it more obvious, what you can try is to try to add inside the list some string, and you will see that this is working. So we can try to add a string,
01:10:55
and now it's concatenated.
01:11:02
And if we wanted to add that list, we'll have something like that. So here I just added my characters, and here I just added the container itself, which is nice here. So here we can add whatever type we want,
01:11:22
so we can approach anything and do the same things. So it's pretty convenient for some types of things. And if you search, it might be not the most efficient for some programming... For instance, if you work on it with numbers, it's probably better to do it with something like arrays,
01:11:43
where you only have a single type, and you don't change it, but you might change memory lines, and I'm sure to access the element inside and to scale it. Is this function working differently in the Python world? I really expect that, no.
01:12:02
Which passion do you have? No, I didn't have one. How big? Because he was... I don't know if you have any clue. So I already spoke about the sortie, but you can tell me if it works already.
01:12:25
We can use the sortie version. So we use already the intlist.sort, and we saw that that was doing modifying X direction, okay?
01:12:41
And another way of doing it, but not changing our list itself, is to use the function sortie. So, and then we do the sorting, but this one we return something, then when we intlist.sort,
01:13:01
we just resort my list also. We use sortie this one, okay? So if I do that, I'm sure that it will give me an error. Okay. Which is kind of obvious why, because now we have a lot of things inside, and the thing that is safe,
01:13:20
I cannot make comparison between the list and the integer. So we try to make, because when we sort, we try to check if it's bigger or smaller, and move the element. So now he's just telling me that actually I don't know how to make a comparison between this and this. So, it's not magic, I mean, it's now your only option,
01:13:41
you should have to stop that and know what to do. So we can restart with a nice piece of this list, and if I use sortie, just do this thing like here,
01:14:00
this one, right? This one returns a list, and if I check my original list, it didn't check, okay? And when we are doing that sort, and I'm checking the int list, so first, here, nothing is written, okay?
01:14:20
Here, when I use it, it returns values, and here it happens, ints are already the results, okay? So usually when you use does, and the number of functions, you modify the variable itself, and otherwise when you use a function, it will already, usually it's written in the function,
01:14:40
written in the values, okay? So that's this part. We already played with the appending. I think that we already saw that, so if I use the first, we saw that that's doing concatenations, if I use the multiply,
01:15:01
what do you expect? If I take a list, for example, this list here, and I can make times three, is it making a big point between each number by three?
01:15:21
Or do you say that it's doing a string? Okay, that's making the concatenations. So now it makes sense, I said that the string was a container, both are containers, both are the same, so in some way, it's not making something too strange.
01:15:41
If you want to add this, and it's doing the numbers, it's already doing the number by tomorrow, and we'll show you how to do that, okay? But in two items, this will just be replicated in the same way here, we can add the int,
01:16:01
that's what we're doing the string, so I can ask if two was in the int history. Okay, and it's going to be two of us, in the same way. So now, that's a small exercise for you. So we created this list,
01:16:21
the pick response of the years, and then you can append one month, and then you can add inside June, May and June, okay? So you start with three months, then you append one year, and then you add two more, okay?
01:16:41
So we have a few minutes to play with that. Any questions?
01:17:51
Questions from the class,
01:18:19
which is just creating the list,
01:18:21
x is equal to three three strings, which are the three response of the year,
01:18:41
and then I would like to append a new value inside, so I can put the function if I check x, I have a new value that's been added, and then I can get names inside, okay?
01:19:05
includes May and June, if I check, this is what we did since ending, so I really have a question that's
01:19:21
something like strengthened or now we can go to what is topper, so now we saw the list I have been ready to make things that we know about topper so we saw that the list are readable so that you can put values topper alone has a new available
01:19:42
list, okay? So it's like we want to create we want it to stay relevant inside but we don't want to be able to change that there is zero use in that so I want to create them so we create it
01:20:02
and then put our elements and now if I check what's the type of x, maybe it's a topper so when I say that it's readable, it means that I use the string if I try to do this
01:20:21
it will tell me topper is a support item inside so it means that I cannot change it okay? So that's what will happen so that can be useful for instance if you want to create the months and you will never change the months of the year, so you can create
01:20:41
I will just use this here and you don't want people to be able to modify the months, and you will use the topper just so if I say that we use the topper for this reason we don't want to change something but sometimes we want to use it
01:21:02
to unpack the parameters so imagine that I have the topper in that way you could be able to get the three values of the topper
01:21:22
in three different variables using these lines so I can say I have those three values here and I want to unpack each of them inside topper and change so doing this then I check I have the value of
01:21:41
the first element topper so I unpack the element topper so that could be useful and that's actually the more common use case for toppers it's more common than so in the month example
01:22:01
personally I would rather use a list because lists tend to represent a sequence of items that are kind of the same so numbers for example you would keep those in a list for a tuple tuples you would rather use
01:22:20
if you have a sequence of different things so first index is something different from the second and then distinguish by their index so lists of similar things have a couple of different things I agree but
01:22:40
we always say you need a list but you read them from the same list so that's the truth then I have a small puzzle so I will just record what we already saw so we saw that
01:23:01
if I do that we saw that when we create a list we get the same value inside and we saw that if I have a topper and I try to modify something it's not working so now as the month
01:23:21
is their size I have a topper where I release inside and what I will try to do is take the elements here and try to obtain the value why do that? why does R first work?
01:23:41
won't work okay, that seems logic because that's a couple of years but I mean, it should raise an error so it raise an error, that's only something but the fun part, I mean, it's just because I find in time if you change them, x
01:24:02
small x actually so we make both which is something kind of weird so then if you think about what Python could have done is, what we did is we took the list, we have pins we tried to place it inside the toppers
01:24:22
and then it fell at that point so we make more operations, even if we raise the errors we append the value to both okay, so it's just something that I won't find so I don't know so it's good that it's pending
01:24:40
because at least, normally you will not try to extend or I know you will try not to continue but it's good to know what Python means so I think it's, I have two types more of containers so one is a set so for the people that maybe make some maps
01:25:01
that's interesting, because a set allows you to make fast set operations so union, difference and those type of things which I'm not going to explain so you can create a set in that way and what you could happen is that you take for me the unique values of this
01:25:22
and then what I have to set I can make I can create, I don't know, set only one value, and then I can say set dot x dot
01:26:05
and then here you have two different things that you can do with a set so difference is intersection, union so that's why, in other words you can use a different between x2 and x and we will, because I have
01:26:20
c in s, it will return me x2 without c so if you have something that you want to make a class some fast, I mean some fast set operations, you have something specific in Python so here I was showing that you can check if it's a set or not so the last thing which is interesting in Python
01:26:43
is the dictionary and I can play with the months example, this is maybe the best thing that you want to use because you might be interested to map the months to actually the number of the months so you could create
01:27:02
the dictionary, and the dictionary is just so a kind of mapping between a key which will be in the board that you can change with a certain value so to create this, the syntax is the following you get your key
01:27:20
so here, here in brackets you get your key, two points and the value and then if I want a new member the key, two points and the value so if I do that then that's the dictionary here, and to access one of the elements
01:27:41
is also a container so I can use square brackets and now I can search my key so my key will generate so I can search and it will return me
01:28:01
the corresponding values so like this you can make class mapping and if you check the function of key you have items, key and values which could be probably something that you can use
01:28:22
which if I check what item it will return one by one a set of elements so it will return me the key and the value of the first dictionary and then it will return me the second and then you can have the same things
01:28:42
if you check you can only get the keys if you want or you can only get the values ok? so that's the thing that the dictionary will use and we'll see afterwards that you can easily
01:29:02
add values to key and things and look over all the elements that will generate an instance that's what this is used for we'll see afterwards so you can add a new item inside the dictionary because the dictionary
01:29:21
you can say March 1943 and now you can add the new things ok? so you use the slash key thing inside or you can even here I give an example you can create another dictionary and you can use the function update
01:29:40
to update the dictionary with another dictionary ok? so ok? that's already in the dictionary do you have any questions with that? so that was all the basic
01:30:04
so now I can go perfect timing perfect timing? alright so now we can take a break
Empfehlungen
Serie mit 43 Medien
Serie mit 9 Medien