import{s as Le,ae as Is,af as ke,f as l,a as p,g as a,D as o,c as B,j as c,k as F,i as t,u as Me,d as n}from"./scheduler.2f9f1739.js";import{S as Te,i as Ae,b as Pe,d as ze,m as qe,a as je,t as Ee,e as Re}from"./index.f9f1dac6.js";import{g as ge,a as He}from"./styles.a749dd55.js";import{M as $e}from"./MarkdownLayout.50a9a114.js";function Ie(es){let r,T="With the growing popularity of AI, the probability of you coming across Python code keeps increasing. In this article, we’ll explore some tips and tricks to improve your code, help you understand them when you come across them, and get the most out of Python.",d,u,i="Specifically for beginners, these tips will help you write cleaner, more effective code, also helping you get more done with less. Let’s dive in!",y,f,Js="1. list comprehension",ts,A,Ns="let’s say you want to write a code that let’s say returns a list of squares of numbers. the normal way of doing this is:",ns,m,Ss=`<code><span class="line"><span style="color: #B392F0">squares </span><span style="color: #F97583">=</span><span style="color: #B392F0"> []</span></span> <span class="line"><span style="color: #F97583">for</span><span style="color: #B392F0"> i </span><span style="color: #F97583">in</span><span style="color: #B392F0"> range</span><span style="color: #BBBBBB">(</span><span style="color: #F8F8F8">1</span><span style="color: #BBBBBB">,</span><span style="color: #F8F8F8">100</span><span style="color: #BBBBBB">):</span></span> <span class="line"><span style="color: #B392F0"> squares</span><span style="color: #BBBBBB">.</span><span style="color: #B392F0">append</span><span style="color: #BBBBBB">(i</span><span style="color: #F97583">*</span><span style="color: #BBBBBB">i)</span></span></code>`,ls,P,Ws="but list comprehension makes it easier to generate a new list based on an existing sequence or iterable.",as,z,Ds="<strong>syntax</strong> > <code>[expression for item in iterable]</code>",os,q,Ks="Here, <code>expression</code> is the value to be included in the new list, <code>item</code> is the element of the iterable being processed",ps,j,Os="Example",Bs,x,Us='<code><span class="line"><span style="color: #B392F0">squares </span><span style="color: #F97583">=</span><span style="color: #B392F0"> [i</span><span style="color: #F97583">*</span><span style="color: #B392F0">i </span><span style="color: #F97583">for</span><span style="color: #B392F0"> i </span><span style="color: #F97583">in</span><span style="color: #B392F0"> range</span><span style="color: #BBBBBB">(</span><span style="color: #F8F8F8">1</span><span style="color: #BBBBBB">,</span><span style="color: #F8F8F8">100</span><span style="color: #BBBBBB">)</span><span style="color: #B392F0">]</span></span></code>',rs,E,Gs="2. lambda",cs,R,Qs="lambda allows you to create functions on the fly and allows you to also turn anything into a function. lambda functions are also called <code>anonymous functions</code>.",is,h,Vs=`<code><span class="line"><span style="color: #B392F0">add_ </span><span style="color: #F97583">=</span><span style="color: #B392F0"> </span><span style="color: #F97583">lambda</span><span style="color: #B392F0"> </span><span style="color: #FF9800">x</span><span style="color: #BBBBBB">,</span><span style="color: #B392F0"> </span><span style="color: #FF9800">y</span><span style="color: #B392F0">: x</span><span style="color: #F97583">+</span><span style="color: #B392F0">y</span></span> <span class="line"><span style="color: #B392F0">add_</span><span style="color: #BBBBBB">(</span><span style="color: #F8F8F8">5</span><span style="color: #BBBBBB">,</span><span style="color: #F8F8F8">7</span><span style="color: #BBBBBB">)</span></span></code>`,ys,g,Xs="Lambda functions are often used as a convenient way to define a function in one line of code. Lambda functions can take up any number of arguments but are only limited by only one expression.",Fs,$,Ys="Here’s an example of using a lambda function with the <code>map()</code> function to square each element of a list:",us,v,Zs=`<code><span class="line"><span style="color: #B392F0">numbers </span><span style="color: #F97583">=</span><span style="color: #B392F0"> [</span><span style="color: #F8F8F8">1</span><span style="color: #BBBBBB">,</span><span style="color: #B392F0"> </span><span style="color: #F8F8F8">2</span><span style="color: #BBBBBB">,</span><span style="color: #B392F0"> </span><span style="color: #F8F8F8">3</span><span style="color: #BBBBBB">,</span><span style="color: #B392F0"> </span><span style="color: #F8F8F8">4</span><span style="color: #BBBBBB">,</span><span style="color: #B392F0"> </span><span style="color: #F8F8F8">5</span><span style="color: #B392F0">]</span></span> <span class="line"><span style="color: #B392F0">squares </span><span style="color: #F97583">=</span><span style="color: #B392F0"> </span><span style="color: #79B8FF">list</span><span style="color: #BBBBBB">(</span><span style="color: #B392F0">map</span><span style="color: #BBBBBB">(</span><span style="color: #F97583">lambda</span><span style="color: #BBBBBB"> </span><span style="color: #FF9800">x</span><span style="color: #BBBBBB">: x</span><span style="color: #F97583">**</span><span style="color: #F8F8F8">2</span><span style="color: #BBBBBB">, numbers))</span></span> <span class="line"><span style="color: #B392F0">print</span><span style="color: #BBBBBB">(squares)</span><span style="color: #B392F0"> </span><span style="color: #6B737C"># Output: [1, 4, 9, 16, 25]</span></span></code>`,ds,I,se="lambda is really really powerful, but you wouldn’t appreciate it much if you are just starting out.",fs,J,ee="3. zip and unzip",ms,N,te="you can use zip to combine two or more lists together. Unlike extending a list with other lists, zip creates a tuple, where each tuple contains items from the corresponding indices of the two lists.",xs,C,ne=`<code><span class="line"><span style="color: #B392F0">names </span><span style="color: #F97583">=</span><span style="color: #B392F0"> [</span><span style="color: #FFAB70">'Alice'</span><span style="color: #BBBBBB">,</span><span style="color: #B392F0"> </span><span style="color: #FFAB70">'Bob'</span><span style="color: #BBBBBB">,</span><span style="color: #B392F0"> </span><span style="color: #FFAB70">'Charlie'</span><span style="color: #B392F0">]</span></span> <span class="line"><span style="color: #B392F0">ages </span><span style="color: #F97583">=</span><span style="color: #B392F0"> [</span><span style="color: #F8F8F8">25</span><span style="color: #BBBBBB">,</span><span style="color: #B392F0"> </span><span style="color: #F8F8F8">30</span><span style="color: #BBBBBB">,</span><span style="color: #B392F0"> </span><span style="color: #F8F8F8">35</span><span style="color: #B392F0">]</span></span> <span class="line"><span style="color: #B392F0">zipped </span><span style="color: #F97583">=</span><span style="color: #B392F0"> zip</span><span style="color: #BBBBBB">(names, ages)</span></span> <span class="line"><span style="color: #79B8FF">list</span><span style="color: #BBBBBB">(zipped)</span><span style="color: #B392F0"> </span><span style="color: #6B737C"># [('Alice', 25), ('Bob', 30), ('Charlie', 35)]</span></span></code>`,hs,S,le="zip can also be in for loops",vs,b,ae=`<code><span class="line"><span style="color: #B392F0">names </span><span style="color: #F97583">=</span><span style="color: #B392F0"> [</span><span style="color: #FFAB70">'Alice'</span><span style="color: #BBBBBB">,</span><span style="color: #B392F0"> </span><span style="color: #FFAB70">'Bob'</span><span style="color: #BBBBBB">,</span><span style="color: #B392F0"> </span><span style="color: #FFAB70">'Charlie'</span><span style="color: #B392F0">]</span></span> <span class="line"><span style="color: #B392F0">ages </span><span style="color: #F97583">=</span><span style="color: #B392F0"> [</span><span style="color: #F8F8F8">25</span><span style="color: #BBBBBB">,</span><span style="color: #B392F0"> </span><span style="color: #F8F8F8">30</span><span style="color: #BBBBBB">,</span><span style="color: #B392F0"> </span><span style="color: #F8F8F8">35</span><span style="color: #B392F0">]</span></span> <span class="line"><span style="color: #F97583">for</span><span style="color: #B392F0"> name</span><span style="color: #BBBBBB">,</span><span style="color: #B392F0"> age </span><span style="color: #F97583">in</span><span style="color: #B392F0"> zip</span><span style="color: #BBBBBB">(names, ages):</span></span> <span class="line"><span style="color: #B392F0"> print</span><span style="color: #BBBBBB">(name, age)</span></span></code>`,Cs,W,oe="you can also use <code>*</code> to reverse do the reverse of zip",bs,_,pe=`<code><span class="line"><span style="color: #B392F0">zipped </span><span style="color: #F97583">=</span><span style="color: #B392F0"> [(</span><span style="color: #FFAB70">'Alice'</span><span style="color: #BBBBBB">,</span><span style="color: #B392F0"> </span><span style="color: #F8F8F8">25</span><span style="color: #B392F0">)</span><span style="color: #BBBBBB">,</span><span style="color: #B392F0"> (</span><span style="color: #FFAB70">'Bob'</span><span style="color: #BBBBBB">,</span><span style="color: #B392F0"> </span><span style="color: #F8F8F8">30</span><span style="color: #B392F0">)</span><span style="color: #BBBBBB">,</span><span style="color: #B392F0"> (</span><span style="color: #FFAB70">'Charlie'</span><span style="color: #BBBBBB">,</span><span style="color: #B392F0"> </span><span style="color: #F8F8F8">35</span><span style="color: #B392F0">)]</span></span> <span class="line"><span style="color: #B392F0">names</span><span style="color: #BBBBBB">,</span><span style="color: #B392F0"> ages </span><span style="color: #F97583">=</span><span style="color: #B392F0"> zip</span><span style="color: #BBBBBB">(</span><span style="color: #F97583">*</span><span style="color: #BBBBBB">zipped)</span><span style="color: #6B737C"># <<<<</span></span> <span class="line"><span style="color: #B392F0">names </span><span style="color: #6B737C"># ('Alice', 'Bob', 'Charlie')</span></span> <span class="line"><span style="color: #B392F0">ages </span><span style="color: #6B737C"># (25, 30, 35)</span></span></code>`,_s,D,Be="4. f-strings",ks,K,re="if you want to format a string in python with some other variables, the old way would be",Hs,k,ce='<code><span class="line"><span style="color: #FFAB70">"my names is {}"</span><span style="color: #BBBBBB">.</span><span style="color: #B392F0">format</span><span style="color: #BBBBBB">(name)</span></span></code>',ws,O,ie="But, this method can get really messy. The f-string addresses this issue in a cleaner and easier way.",Ls,H,ye='<code><span class="line"><span style="color: #F97583">f</span><span style="color: #FFAB70">"my name is </span><span style="color: #F8F8F8">{</span><span style="color: #B392F0">name</span><span style="color: #F8F8F8">}</span><span style="color: #FFAB70">"</span></span></code>',Ms,U,Fe="all you need is to add an <code>f</code> at the beginning of the string and use <code>curly braces {}</code> to add anything from variables, arithmetics or even function calls",Ts,G,ue="5 .join, .get functions",As,Q,de="if you have a list of strings and you want to concatenate all of them with a separator in between, it is much easier to use the <code>.join</code> method.",Ps,w,fe=`<code><span class="line"><span style="color: #B392F0">names </span><span style="color: #F97583">=</span><span style="color: #B392F0"> [</span><span style="color: #FFAB70">'Alice'</span><span style="color: #BBBBBB">,</span><span style="color: #B392F0"> </span><span style="color: #FFAB70">'Bob'</span><span style="color: #BBBBBB">,</span><span style="color: #B392F0"> </span><span style="color: #FFAB70">'Charlie'</span><span style="color: #B392F0">]</span></span> <span class="line"><span style="color: #B392F0">print</span><span style="color: #BBBBBB">(</span><span style="color: #FFAB70">''</span><span style="color: #BBBBBB">.</span><span style="color: #B392F0">join</span><span style="color: #BBBBBB">(names))</span><span style="color: #B392F0"> </span><span style="color: #6B737C">#AliceBobCharlie</span></span> <span class="line"><span style="color: #B392F0">print</span><span style="color: #BBBBBB">(</span><span style="color: #FFAB70">' '</span><span style="color: #BBBBBB">.</span><span style="color: #B392F0">join</span><span style="color: #BBBBBB">(names))</span><span style="color: #B392F0"> </span><span style="color: #6B737C">#Alice Bob Charlie</span></span> <span class="line"><span style="color: #B392F0">print</span><span style="color: #BBBBBB">(</span><span style="color: #FFAB70">','</span><span style="color: #BBBBBB">.</span><span style="color: #B392F0">join</span><span style="color: #BBBBBB">(names))</span><span style="color: #B392F0"> </span><span style="color: #6B737C">#Alice,Bob,Charlie</span></span> <span class="line"><span style="color: #B392F0">print</span><span style="color: #BBBBBB">(</span><span style="color: #FFAB70">'*'</span><span style="color: #BBBBBB">.</span><span style="color: #B392F0">join</span><span style="color: #BBBBBB">(names))</span><span style="color: #B392F0"> </span><span style="color: #6B737C">#Alice*Bob*Charlie</span></span></code>`,zs,V,me="Additionally, instead of the traditional way of getting a value from a dictionary, it is much more efficient to use the <code>get</code> method.",qs,L,xe=`<code><span class="line"><span style="color: #B392F0">students </span><span style="color: #F97583">=</span><span style="color: #B392F0"> </span><span style="color: #BBBBBB">{</span><span style="color: #FFAB70">'Alice'</span><span style="color: #BBBBBB">:</span><span style="color: #FFAB70">'Economics'</span><span style="color: #BBBBBB">,</span><span style="color: #B392F0"> </span><span style="color: #FFAB70">'Bob'</span><span style="color: #BBBBBB">:</span><span style="color: #FFAB70">'Physics'</span><span style="color: #BBBBBB">,</span><span style="color: #B392F0"> </span><span style="color: #FFAB70">'Charlie'</span><span style="color: #BBBBBB">:</span><span style="color: #FFAB70">'Math'</span><span style="color: #BBBBBB">}</span></span> <span class="line"></span> <span class="line"><span style="color: #B392F0">students</span><span style="color: #BBBBBB">[</span><span style="color: #FFAB70">'John'</span><span style="color: #BBBBBB">]</span><span style="color: #B392F0"> </span><span style="color: #6B737C"># return KeyError</span></span> <span class="line"><span style="color: #B392F0">students</span><span style="color: #BBBBBB">.</span><span style="color: #B392F0">get</span><span style="color: #BBBBBB">(</span><span style="color: #FFAB70">'John'</span><span style="color: #BBBBBB">)</span><span style="color: #B392F0"> </span><span style="color: #6B737C"># return None</span></span></code>`,js,X,he="you can also set a default value, which will be returned instead if the key is not found in the dictionary",Es,M,ve='<code><span class="line"><span style="color: #B392F0">students</span><span style="color: #BBBBBB">.</span><span style="color: #B392F0">get</span><span style="color: #BBBBBB">(</span><span style="color: #FFAB70">'John'</span><span style="color: #BBBBBB">, </span><span style="color: #FFAB70">'Not Found'</span><span style="color: #BBBBBB">)</span><span style="color: #B392F0"> </span><span style="color: #6B737C"># returns Not Found</span></span></code>',Rs,Y,Ce="Conclusion",gs,Z,be="These tips will definitely help out a lot, even if you don’t use them yourself, you would probably come across them in someone else’s code. Hence, makes it easier for you to understand what’s happening.",$s,ss,_e="<strong>Happy Coding!</strong>";return{c(){r=l("p"),r.textContent=T,d=p(),u=l("p"),u.textContent=i,y=p(),f=l("h3"),f.textContent=Js,ts=p(),A=l("p"),A.textContent=Ns,ns=p(),m=l("pre"),m.innerHTML=Ss,ls=p(),P=l("p"),P.textContent=Ws,as=p(),z=l("p"),z.innerHTML=Ds,os=p(),q=l("p"),q.innerHTML=Ks,ps=p(),j=l("h6"),j.textContent=Os,Bs=p(),x=l("pre"),x.innerHTML=Us,rs=p(),E=l("h3"),E.textContent=Gs,cs=p(),R=l("p"),R.innerHTML=Qs,is=p(),h=l("pre"),h.innerHTML=Vs,ys=p(),g=l("p"),g.textContent=Xs,Fs=p(),$=l("p"),$.innerHTML=Ys,us=p(),v=l("pre"),v.innerHTML=Zs,ds=p(),I=l("p"),I.textContent=se,fs=p(),J=l("h3"),J.textContent=ee,ms=p(),N=l("p"),N.textContent=te,xs=p(),C=l("pre"),C.innerHTML=ne,hs=p(),S=l("p"),S.textContent=le,vs=p(),b=l("pre"),b.innerHTML=ae,Cs=p(),W=l("p"),W.innerHTML=oe,bs=p(),_=l("pre"),_.innerHTML=pe,_s=p(),D=l("h3"),D.textContent=Be,ks=p(),K=l("p"),K.textContent=re,Hs=p(),k=l("pre"),k.innerHTML=ce,ws=p(),O=l("p"),O.textContent=ie,Ls=p(),H=l("pre"),H.innerHTML=ye,Ms=p(),U=l("p"),U.innerHTML=Fe,Ts=p(),G=l("h3"),G.textContent=ue,As=p(),Q=l("p"),Q.innerHTML=de,Ps=p(),w=l("pre"),w.innerHTML=fe,zs=p(),V=l("p"),V.innerHTML=me,qs=p(),L=l("pre"),L.innerHTML=xe,js=p(),X=l("p"),X.textContent=he,Es=p(),M=l("pre"),M.innerHTML=ve,Rs=p(),Y=l("h3"),Y.textContent=Ce,gs=p(),Z=l("p"),Z.textContent=be,$s=p(),ss=l("p"),ss.innerHTML=_e,this.h()},l(s){r=a(s,"P",{"data-svelte-h":!0}),o(r)!=="svelte-z77lon"&&(r.textContent=T),d=B(s),u=a(s,"P",{"data-svelte-h":!0}),o(u)!=="svelte-ai06nr"&&(u.textContent=i),y=B(s),f=a(s,"H3",{"data-svelte-h":!0}),o(f)!=="svelte-1d9cju1"&&(f.textContent=Js),ts=B(s),A=a(s,"P",{"data-svelte-h":!0}),o(A)!=="svelte-14w9cg7"&&(A.textContent=Ns),ns=B(s),m=a(s,"PRE",{class:!0,style:!0,tabindex:!0,"data-svelte-h":!0}),o(m)!=="svelte-15rf1da"&&(m.innerHTML=Ss),ls=B(s),P=a(s,"P",{"data-svelte-h":!0}),o(P)!=="svelte-pu1bdl"&&(P.textContent=Ws),as=B(s),z=a(s,"P",{"data-svelte-h":!0}),o(z)!=="svelte-17o1ug4"&&(z.innerHTML=Ds),os=B(s),q=a(s,"P",{"data-svelte-h":!0}),o(q)!=="svelte-1i9lsxf"&&(q.innerHTML=Ks),ps=B(s),j=a(s,"H6",{"data-svelte-h":!0}),o(j)!=="svelte-o6l7m0"&&(j.textContent=Os),Bs=B(s),x=a(s,"PRE",{class:!0,style:!0,tabindex:!0,"data-svelte-h":!0}),o(x)!=="svelte-1hetre8"&&(x.innerHTML=Us),rs=B(s),E=a(s,"H3",{"data-svelte-h":!0}),o(E)!=="svelte-11szabr"&&(E.textContent=Gs),cs=B(s),R=a(s,"P",{"data-svelte-h":!0}),o(R)!=="svelte-jzsjc8"&&(R.innerHTML=Qs),is=B(s),h=a(s,"PRE",{class:!0,style:!0,tabindex:!0,"data-svelte-h":!0}),o(h)!=="svelte-lnc2sl"&&(h.innerHTML=Vs),ys=B(s),g=a(s,"P",{"data-svelte-h":!0}),o(g)!=="svelte-1nu3zhy"&&(g.textContent=Xs),Fs=B(s),$=a(s,"P",{"data-svelte-h":!0}),o($)!=="svelte-kbgj0y"&&($.innerHTML=Ys),us=B(s),v=a(s,"PRE",{class:!0,style:!0,tabindex:!0,"data-svelte-h":!0}),o(v)!=="svelte-1hdwoyb"&&(v.innerHTML=Zs),ds=B(s),I=a(s,"P",{"data-svelte-h":!0}),o(I)!=="svelte-q7r1l"&&(I.textContent=se),fs=B(s),J=a(s,"H3",{"data-svelte-h":!0}),o(J)!=="svelte-hjxhx1"&&(J.textContent=ee),ms=B(s),N=a(s,"P",{"data-svelte-h":!0}),o(N)!=="svelte-135xtxg"&&(N.textContent=te),xs=B(s),C=a(s,"PRE",{class:!0,style:!0,tabindex:!0,"data-svelte-h":!0}),o(C)!=="svelte-15td50x"&&(C.innerHTML=ne),hs=B(s),S=a(s,"P",{"data-svelte-h":!0}),o(S)!=="svelte-13pglt4"&&(S.textContent=le),vs=B(s),b=a(s,"PRE",{class:!0,style:!0,tabindex:!0,"data-svelte-h":!0}),o(b)!=="svelte-2f6ixt"&&(b.innerHTML=ae),Cs=B(s),W=a(s,"P",{"data-svelte-h":!0}),o(W)!=="svelte-1k92zxz"&&(W.innerHTML=oe),bs=B(s),_=a(s,"PRE",{class:!0,style:!0,tabindex:!0,"data-svelte-h":!0}),o(_)!=="svelte-1p9xoso"&&(_.innerHTML=pe),_s=B(s),D=a(s,"H3",{"data-svelte-h":!0}),o(D)!=="svelte-11zn4sf"&&(D.textContent=Be),ks=B(s),K=a(s,"P",{"data-svelte-h":!0}),o(K)!=="svelte-1w2ah7t"&&(K.textContent=re),Hs=B(s),k=a(s,"PRE",{class:!0,style:!0,tabindex:!0,"data-svelte-h":!0}),o(k)!=="svelte-nt6u2o"&&(k.innerHTML=ce),ws=B(s),O=a(s,"P",{"data-svelte-h":!0}),o(O)!=="svelte-5x1ujz"&&(O.textContent=ie),Ls=B(s),H=a(s,"PRE",{class:!0,style:!0,tabindex:!0,"data-svelte-h":!0}),o(H)!=="svelte-iaal2d"&&(H.innerHTML=ye),Ms=B(s),U=a(s,"P",{"data-svelte-h":!0}),o(U)!=="svelte-1igl8i6"&&(U.innerHTML=Fe),Ts=B(s),G=a(s,"H3",{"data-svelte-h":!0}),o(G)!=="svelte-ycngxc"&&(G.textContent=ue),As=B(s),Q=a(s,"P",{"data-svelte-h":!0}),o(Q)!=="svelte-1x59cpd"&&(Q.innerHTML=de),Ps=B(s),w=a(s,"PRE",{class:!0,style:!0,tabindex:!0,"data-svelte-h":!0}),o(w)!=="svelte-17hcm4w"&&(w.innerHTML=fe),zs=B(s),V=a(s,"P",{"data-svelte-h":!0}),o(V)!=="svelte-1dc9l2v"&&(V.innerHTML=me),qs=B(s),L=a(s,"PRE",{class:!0,style:!0,tabindex:!0,"data-svelte-h":!0}),o(L)!=="svelte-8w7480"&&(L.innerHTML=xe),js=B(s),X=a(s,"P",{"data-svelte-h":!0}),o(X)!=="svelte-ulovuq"&&(X.textContent=he),Es=B(s),M=a(s,"PRE",{class:!0,style:!0,tabindex:!0,"data-svelte-h":!0}),o(M)!=="svelte-1ton85h"&&(M.innerHTML=ve),Rs=B(s),Y=a(s,"H3",{"data-svelte-h":!0}),o(Y)!=="svelte-d7kqkf"&&(Y.textContent=Ce),gs=B(s),Z=a(s,"P",{"data-svelte-h":!0}),o(Z)!=="svelte-qkn2kf"&&(Z.textContent=be),$s=B(s),ss=a(s,"P",{"data-svelte-h":!0}),o(ss)!=="svelte-15pa89m"&&(ss.innerHTML=_e),this.h()},h(){c(m,"class","shiki min-dark"),F(m,"background-color","#1f1f1f"),c(m,"tabindex","0"),c(x,"class","shiki min-dark"),F(x,"background-color","#1f1f1f"),c(x,"tabindex","0"),c(h,"class","shiki min-dark"),F(h,"background-color","#1f1f1f"),c(h,"tabindex","0"),c(v,"class","shiki min-dark"),F(v,"background-color","#1f1f1f"),c(v,"tabindex","0"),c(C,"class","shiki min-dark"),F(C,"background-color","#1f1f1f"),c(C,"tabindex","0"),c(b,"class","shiki min-dark"),F(b,"background-color","#1f1f1f"),c(b,"tabindex","0"),c(_,"class","shiki min-dark"),F(_,"background-color","#1f1f1f"),c(_,"tabindex","0"),c(k,"class","shiki min-dark"),F(k,"background-color","#1f1f1f"),c(k,"tabindex","0"),c(H,"class","shiki min-dark"),F(H,"background-color","#1f1f1f"),c(H,"tabindex","0"),c(w,"class","shiki min-dark"),F(w,"background-color","#1f1f1f"),c(w,"tabindex","0"),c(L,"class","shiki min-dark"),F(L,"background-color","#1f1f1f"),c(L,"tabindex","0"),c(M,"class","shiki min-dark"),F(M,"background-color","#1f1f1f"),c(M,"tabindex","0")},m(s,e){t(s,r,e),t(s,d,e),t(s,u,e),t(s,y,e),t(s,f,e),t(s,ts,e),t(s,A,e),t(s,ns,e),t(s,m,e),t(s,ls,e),t(s,P,e),t(s,as,e),t(s,z,e),t(s,os,e),t(s,q,e),t(s,ps,e),t(s,j,e),t(s,Bs,e),t(s,x,e),t(s,rs,e),t(s,E,e),t(s,cs,e),t(s,R,e),t(s,is,e),t(s,h,e),t(s,ys,e),t(s,g,e),t(s,Fs,e),t(s,$,e),t(s,us,e),t(s,v,e),t(s,ds,e),t(s,I,e),t(s,fs,e),t(s,J,e),t(s,ms,e),t(s,N,e),t(s,xs,e),t(s,C,e),t(s,hs,e),t(s,S,e),t(s,vs,e),t(s,b,e),t(s,Cs,e),t(s,W,e),t(s,bs,e),t(s,_,e),t(s,_s,e),t(s,D,e),t(s,ks,e),t(s,K,e),t(s,Hs,e),t(s,k,e),t(s,ws,e),t(s,O,e),t(s,Ls,e),t(s,H,e),t(s,Ms,e),t(s,U,e),t(s,Ts,e),t(s,G,e),t(s,As,e),t(s,Q,e),t(s,Ps,e),t(s,w,e),t(s,zs,e),t(s,V,e),t(s,qs,e),t(s,L,e),t(s,js,e),t(s,X,e),t(s,Es,e),t(s,M,e),t(s,Rs,e),t(s,Y,e),t(s,gs,e),t(s,Z,e),t(s,$s,e),t(s,ss,e)},p:Me,d(s){s&&(n(r),n(d),n(u),n(y),n(f),n(ts),n(A),n(ns),n(m),n(ls),n(P),n(as),n(z),n(os),n(q),n(ps),n(j),n(Bs),n(x),n(rs),n(E),n(cs),n(R),n(is),n(h),n(ys),n(g),n(Fs),n($),n(us),n(v),n(ds),n(I),n(fs),n(J),n(ms),n(N),n(xs),n(C),n(hs),n(S),n(vs),n(b),n(Cs),n(W),n(bs),n(_),n(_s),n(D),n(ks),n(K),n(Hs),n(k),n(ws),n(O),n(Ls),n(H),n(Ms),n(U),n(Ts),n(G),n(As),n(Q),n(Ps),n(w),n(zs),n(V),n(qs),n(L),n(js),n(X),n(Es),n(M),n(Rs),n(Y),n(gs),n(Z),n($s),n(ss))}}}function Je(es){let r,T;const d=[es[0],we];let u={$$slots:{default:[Ie]},$$scope:{ctx:es}};for(let i=0;i<d.length;i+=1)u=Is(u,d[i]);return r=new $e({props:u}),{c(){Pe(r.$$.fragment)},l(i){ze(r.$$.fragment,i)},m(i,y){qe(r,i,y),T=!0},p(i,[y]){const f=y&1?ge(d,[y&1&&He(i[0]),y&0&&He(we)]):{};y&2&&(f.$$scope={dirty:y,ctx:i}),r.$set(f)},i(i){T||(je(r.$$.fragment,i),T=!0)},o(i){Ee(r.$$.fragment,i),T=!1},d(i){Re(r,i)}}}const we={title:"Python tips and tricks",description:"With the growing popularity of AI, the probability of you coming across Python code keeps increasing. In this article, we'll explore some tips and tricks to improve your code, help you understand them when you come across them, and get the most out of Python.",date:"2023-5-14",lastmod:"2024-01-12",categories:["python","tips","how to"],published:!0};function Ne(es,r,T){return es.$$set=d=>{T(0,r=Is(Is({},r),ke(d)))},r=ke(r),[r]}class Oe extends Te{constructor(r){super(),Ae(this,r,Ne,Je,Le,{})}}export{Oe as default,we as metadata};