[{"data":1,"prerenderedAt":1339},["ShallowReactive",2],{"/blog/learn-python-with-pj-part-2":3,"navigation-en-us":587,"banner-en-us":1023,"footer-en-us":1031,"blog-post-authors-en-us-PJ Metz":1278,"blog-related-posts-en-us-learn-python-with-pj-part-2":1294,"blog-share-wrapper-en-us":1319,"next-steps-en-us":1329},{"id":4,"title":5,"authors":6,"body":8,"category":566,"date":567,"description":568,"extension":569,"externalUrl":570,"faq":570,"featured":571,"heroImage":572,"hidePromo":571,"meta":573,"navigation":143,"path":574,"seo":575,"slug":579,"stem":580,"tags":581,"template":585,"updatedDate":570,"__hash__":586},"blogPosts/en-us/blog/learn-python-with-pj-part-2.md","Learn Python with Pj! Part 2 - Lists and loops",[7],"PJ Metz",{"type":9,"value":10,"toc":555},"minimark",[11,21,26,29,80,91,98,110,115,118,179,183,186,253,257,260,293,304,308,318,320,323,349,352,404,407,417,462,468,470,473,531,534,542,551],[12,13,14,15,20],"p",{},"We’re back with another article about my journey to learn Python. Check out the ",[16,17,19],"a",{"href":18},"/blog/learn-python-with-pj-part-1/","first article"," if you want to see what I’ve already learned. Today we’re talking about lists and loops, two important parts of all programming languages. Let’s check them out.",[22,23,25],"h2",{"id":24},"lists","Lists",[12,27,28],{},"Lists are a way to store information that can be accessed later. They are similar to arrays in other languages. A list is a named collection of other elements inside brackets that can be accessed by an index number.",[30,31,36],"pre",{"className":32,"code":33,"language":34,"meta":35,"style":35},"language-python shiki shiki-themes github-light","#I will be using this list for all our examples, and, yes, these are some of my favorite musical acts pulled directly from my Spotify 2021 wrapped. \nfavorite_music = ['The Midnight', 'Night Tempo', 'St. Lucia'] \n","python","",[37,38,39,48],"code",{"__ignoreMap":35},[40,41,44],"span",{"class":42,"line":43},"line",1,[40,45,47],{"class":46},"sAwPA","#I will be using this list for all our examples, and, yes, these are some of my favorite musical acts pulled directly from my Spotify 2021 wrapped. \n",[40,49,51,55,59,62,66,69,72,74,77],{"class":42,"line":50},2,[40,52,54],{"class":53},"sgsFI","favorite_music ",[40,56,58],{"class":57},"sD7c4","=",[40,60,61],{"class":53}," [",[40,63,65],{"class":64},"sYBdl","'The Midnight'",[40,67,68],{"class":53},", ",[40,70,71],{"class":64},"'Night Tempo'",[40,73,68],{"class":53},[40,75,76],{"class":64},"'St. Lucia'",[40,78,79],{"class":53},"]\n",[12,81,82,83,86,87,90],{},"In this list, each element of the list can be accessed by an index number. Like many other languages, python is zero-indexed, meaning the first element is at index 0. So favorite_music",[40,84,85],{},"0"," is “The Midnight”, favorite_music",[40,88,89],{},"1"," is “Night Tempo”, and so on.",[12,92,93,94,97],{},"Something interesting about lists in Python is that a negative 1 index number will give you the last element in the list. Negative 2 will give you the second to last, and so on. As far as I can tell, this isn’t possible in other languages: Negative 1 indices will return errors or ",[37,95,96],{},"undefined"," in arrays or lists in other languages. I imagine a scenario where we’ve just added something to a list and need to access it immediately. We could use the negative index number to access the most recently added element.",[12,99,100,101,104,105,103],{},"Python comes with several built-in methods to be used with lists. Some of them have the list passed in as an argument, some are added to the list with a ",[37,102,103],{},"."," so it can be used. These methods will change the list or return some kind of information about the list. Below are a few I found useful, but a more complete explanation of available methods is ",[16,106,109],{"href":107,"rel":108},"https://docs.python.org/3/tutorial/datastructures.html",[],"available here",[111,112,114],"h3",{"id":113},"pop",".pop()",[12,116,117],{},"Pop allows you to remove a specific element in a list as well as return it at the same time, meaning this can be set to a variable. To specify the element, use the desired index number inside the parentheses to remove it.",[30,119,121],{"className":32,"code":120,"language":34,"meta":35,"style":35},"best_synthwave = favorite_music.pop(0)\n\n#returns ‘['Night Tempo', 'St. Lucia']’\nprint(favorite_music)\n\n#returns 'The Midnight'\nprint(best_synthwave)\n",[37,122,123,139,145,151,160,165,171],{"__ignoreMap":35},[40,124,125,128,130,133,136],{"class":42,"line":43},[40,126,127],{"class":53},"best_synthwave ",[40,129,58],{"class":57},[40,131,132],{"class":53}," favorite_music.pop(",[40,134,85],{"class":135},"sYu0t",[40,137,138],{"class":53},")\n",[40,140,141],{"class":42,"line":50},[40,142,144],{"emptyLinePlaceholder":143},true,"\n",[40,146,148],{"class":42,"line":147},3,[40,149,150],{"class":46},"#returns ‘['Night Tempo', 'St. Lucia']’\n",[40,152,154,157],{"class":42,"line":153},4,[40,155,156],{"class":135},"print",[40,158,159],{"class":53},"(favorite_music)\n",[40,161,163],{"class":42,"line":162},5,[40,164,144],{"emptyLinePlaceholder":143},[40,166,168],{"class":42,"line":167},6,[40,169,170],{"class":46},"#returns 'The Midnight'\n",[40,172,174,176],{"class":42,"line":173},7,[40,175,156],{"class":135},[40,177,178],{"class":53},"(best_synthwave)\n",[111,180,182],{"id":181},"append-and-insert",".append() and .insert()",[12,184,185],{},"Append allows you to add an element to a list. Put the element in the parenthesis. The element is added to the end of the list. Insert allows you to say exactly where you would like the element inserted. The first argument is the index you would like to replace, and the second argument is the element to insert.",[30,187,189],{"className":32,"code":188,"language":34,"meta":35,"style":35},"favorite_music.append('Turnstile') \n\n#This will print ['The Midnight', 'Night Tempo', 'St. Lucia', 'Turnstile']\nprint(favorite_music)\n\nfavorite_music.insert(1, 'Kendrick Lamar')\n#This will print 'The Midnight', 'Kendrick Lamar', 'Night Tempo', 'St. Lucia', 'Turnstile'] \n#Turnstile is still there since we appended it before. \nprint(favorite_music)\n",[37,190,191,202,206,211,217,221,235,240,246],{"__ignoreMap":35},[40,192,193,196,199],{"class":42,"line":43},[40,194,195],{"class":53},"favorite_music.append(",[40,197,198],{"class":64},"'Turnstile'",[40,200,201],{"class":53},") \n",[40,203,204],{"class":42,"line":50},[40,205,144],{"emptyLinePlaceholder":143},[40,207,208],{"class":42,"line":147},[40,209,210],{"class":46},"#This will print ['The Midnight', 'Night Tempo', 'St. Lucia', 'Turnstile']\n",[40,212,213,215],{"class":42,"line":153},[40,214,156],{"class":135},[40,216,159],{"class":53},[40,218,219],{"class":42,"line":162},[40,220,144],{"emptyLinePlaceholder":143},[40,222,223,226,228,230,233],{"class":42,"line":167},[40,224,225],{"class":53},"favorite_music.insert(",[40,227,89],{"class":135},[40,229,68],{"class":53},[40,231,232],{"class":64},"'Kendrick Lamar'",[40,234,138],{"class":53},[40,236,237],{"class":42,"line":173},[40,238,239],{"class":46},"#This will print 'The Midnight', 'Kendrick Lamar', 'Night Tempo', 'St. Lucia', 'Turnstile'] \n",[40,241,243],{"class":42,"line":242},8,[40,244,245],{"class":46},"#Turnstile is still there since we appended it before. \n",[40,247,249,251],{"class":42,"line":248},9,[40,250,156],{"class":135},[40,252,159],{"class":53},[111,254,256],{"id":255},"len","len()",[12,258,259],{},"Len gets the length of the object passed into it. This is important since you can know exactly how many elements are in a list, which is useful for control flow as well as loops.",[30,261,263],{"className":32,"code":262,"language":34,"meta":35,"style":35},"length_of_music = len(favorite_music)\n\n#working with the original list will print “3”\nprint(length_of_music)\n",[37,264,265,277,281,286],{"__ignoreMap":35},[40,266,267,270,272,275],{"class":42,"line":43},[40,268,269],{"class":53},"length_of_music ",[40,271,58],{"class":57},[40,273,274],{"class":135}," len",[40,276,159],{"class":53},[40,278,279],{"class":42,"line":50},[40,280,144],{"emptyLinePlaceholder":143},[40,282,283],{"class":42,"line":147},[40,284,285],{"class":46},"#working with the original list will print “3”\n",[40,287,288,290],{"class":42,"line":153},[40,289,156],{"class":135},[40,291,292],{"class":53},"(length_of_music)\n",[12,294,295,296,68,298,300,301,103],{},"Notice that it prints how many elements are in the list, not how many indices. I have to work to make sure to keep those two ideas separate. So there are three elements in the list, but the indices are ",[40,297,85],{},[40,299,89],{},", and ",[40,302,303],{},"2",[22,305,307],{"id":306},"loops","Loops",[12,309,310,311,314,315,103],{},"Loops work very much the same way they do in other languages, but like I’ve seen with the rest of Python, the syntax is more readable and the code just looks a bit cleaner. The two main ways to use loops with Python are ",[37,312,313],{},"for"," and ",[37,316,317],{},"while",[111,319,313],{"id":313},[12,321,322],{},"For is used when you want to iterate through each element in an object. The syntax you use here creates a kind of one-time use variable that is then used in the code block in a variety of ways. Let’s say you want to print each band from the favorite_music list from before.",[30,324,326],{"className":32,"code":325,"language":34,"meta":35,"style":35},"for band in favorite_music:\n  print(band)\n\n",[37,327,328,341],{"__ignoreMap":35},[40,329,330,332,335,338],{"class":42,"line":43},[40,331,313],{"class":57},[40,333,334],{"class":53}," band ",[40,336,337],{"class":57},"in",[40,339,340],{"class":53}," favorite_music:\n",[40,342,343,346],{"class":42,"line":50},[40,344,345],{"class":135},"  print",[40,347,348],{"class":53},"(band)\n",[12,350,351],{},"This would print each band on its own line. If you call print() on favorite_music, it would print the array inside of brackets. You can perform logic inside of for loops to only return certain items. Say you want to only print bands that have “night” in the name:",[30,353,355],{"className":32,"code":354,"language":34,"meta":35,"style":35},"for band in favorite_music:\n    lower_case_band = band.lower()\n    if lower_case_band.__contains__('night'):\n      print(band)\n\n",[37,356,357,367,377,397],{"__ignoreMap":35},[40,358,359,361,363,365],{"class":42,"line":43},[40,360,313],{"class":57},[40,362,334],{"class":53},[40,364,337],{"class":57},[40,366,340],{"class":53},[40,368,369,372,374],{"class":42,"line":50},[40,370,371],{"class":53},"    lower_case_band ",[40,373,58],{"class":57},[40,375,376],{"class":53}," band.lower()\n",[40,378,379,382,385,388,391,394],{"class":42,"line":147},[40,380,381],{"class":57},"    if",[40,383,384],{"class":53}," lower_case_band.",[40,386,387],{"class":135},"__contains__",[40,389,390],{"class":53},"(",[40,392,393],{"class":64},"'night'",[40,395,396],{"class":53},"):\n",[40,398,399,402],{"class":42,"line":153},[40,400,401],{"class":135},"      print",[40,403,348],{"class":53},[12,405,406],{},"Note: I put all the strings into lower case so we could match cases. Also, I found the contains method on the internet and the example had two underscores on either side. It made my code work whereas without the underscores it did not work. Like I said in the first article, I’m new here and don’t know why it did that.",[12,408,409,413,414,416],{},[410,411,412],"strong",{},"EDIT March 7, 2022:"," According to commenter \"Glen666\" in the comments, the easier way to check if something is contained in another object is to use the ",[37,415,337],{}," operator. It would look like this:",[30,418,420],{"className":32,"code":419,"language":34,"meta":35,"style":35},"for band in favorite_music:\n  lower_case_band = band.lower()\n  if \"night\" in lower_case_band:\n    print(band)\n\n",[37,421,422,432,441,455],{"__ignoreMap":35},[40,423,424,426,428,430],{"class":42,"line":43},[40,425,313],{"class":57},[40,427,334],{"class":53},[40,429,337],{"class":57},[40,431,340],{"class":53},[40,433,434,437,439],{"class":42,"line":50},[40,435,436],{"class":53},"  lower_case_band ",[40,438,58],{"class":57},[40,440,376],{"class":53},[40,442,443,446,449,452],{"class":42,"line":147},[40,444,445],{"class":57},"  if",[40,447,448],{"class":64}," \"night\"",[40,450,451],{"class":57}," in",[40,453,454],{"class":53}," lower_case_band:\n",[40,456,457,460],{"class":42,"line":153},[40,458,459],{"class":135},"    print",[40,461,348],{"class":53},[12,463,464,465,467],{},"Thanks for catching this. I hadn't learned ",[37,466,337],{}," yet so this makes it a bit easier!",[111,469,317],{"id":317},[12,471,472],{},"While creates a loop that goes as long as certain criteria are being satisfied, usually a logic expression. If you want some code to run six times, you could use a while loop.",[30,474,476],{"className":32,"code":475,"language":34,"meta":35,"style":35},"i = 0\n#This prints the string below 6 times. \nwhile i \u003C 7:\n  print('The Midnight is my favorite band of all time.')\n  i += 1\n\n",[37,477,478,488,493,509,520],{"__ignoreMap":35},[40,479,480,483,485],{"class":42,"line":43},[40,481,482],{"class":53},"i ",[40,484,58],{"class":57},[40,486,487],{"class":135}," 0\n",[40,489,490],{"class":42,"line":50},[40,491,492],{"class":46},"#This prints the string below 6 times. \n",[40,494,495,497,500,503,506],{"class":42,"line":147},[40,496,317],{"class":57},[40,498,499],{"class":53}," i ",[40,501,502],{"class":57},"\u003C",[40,504,505],{"class":135}," 7",[40,507,508],{"class":53},":\n",[40,510,511,513,515,518],{"class":42,"line":153},[40,512,345],{"class":135},[40,514,390],{"class":53},[40,516,517],{"class":64},"'The Midnight is my favorite band of all time.'",[40,519,138],{"class":53},[40,521,522,525,528],{"class":42,"line":162},[40,523,524],{"class":53},"  i ",[40,526,527],{"class":57},"+=",[40,529,530],{"class":135}," 1\n",[12,532,533],{},"This is useful if you want code to run the whole time some circumstance is true, whether it’s a date, another process is running, or anything of the sort.",[12,535,536,538,539,541],{},[410,537,412],{}," Thanks to user \"magicolf\" in the comments! They let me know that there's an error here where it prints 7 times instead of 6. Because i is declared as ",[37,540,85],{}," first, the loop will actually print seven times. It's easy to make mistakes like this all the time, so I appreciate you letting me know, magicolf!",[12,543,544,545,550],{},"Loops are some of my favorite things to write so far. It’s like a little puzzle to figure out when you need to iterate through a list or string to make something happen at a specific time. The hardest part about loops is getting used to the logic of it. Python made this easier for me in that loops feel very natural to read. On top of that, I’m getting used to the indentation that I felt was so strange last time. I’ve spent about 30 or so hours working on it so far, and It’s starting to feel very natural. Hopefully, I can keep this up as we move on to the ",[16,546,549],{"href":547,"rel":548},"https://about.gitlab.com/blog/learn-python-with-pj-part-3/",[],"next learning modules","!",[552,553,554],"style",{},"html pre.shiki code .sAwPA, html code.shiki .sAwPA{--shiki-default:#6A737D}html pre.shiki code .sgsFI, html code.shiki .sgsFI{--shiki-default:#24292E}html pre.shiki code .sD7c4, html code.shiki .sD7c4{--shiki-default:#D73A49}html pre.shiki code .sYBdl, html code.shiki .sYBdl{--shiki-default:#032F62}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .sYu0t, html code.shiki .sYu0t{--shiki-default:#005CC5}",{"title":35,"searchDepth":50,"depth":50,"links":556},[557,562],{"id":24,"depth":50,"text":25,"children":558},[559,560,561],{"id":113,"depth":147,"text":114},{"id":181,"depth":147,"text":182},{"id":255,"depth":147,"text":256},{"id":306,"depth":50,"text":307,"children":563},[564,565],{"id":313,"depth":147,"text":313},{"id":317,"depth":147,"text":317},"engineering","2022-03-01","Follow along as our education evangelist Pj Metz learns about lists and loops in the second of this multipart series.","md",null,false,"https://res.cloudinary.com/about-gitlab-com/image/upload/v1749664962/Blog/Hero%20Images/python.jpg",{},"/en-us/blog/learn-python-with-pj-part-2",{"title":5,"description":568,"ogTitle":5,"ogDescription":568,"noIndex":571,"ogImage":572,"ogUrl":576,"ogSiteName":577,"ogType":578,"canonicalUrls":576},"https://about.gitlab.com/blog/learn-python-with-pj-part-2","https://about.gitlab.com","article","learn-python-with-pj-part-2","en-us/blog/learn-python-with-pj-part-2",[582,583,584],"careers","DevOps","growth","BlogPost","FSIpgbBCYomWDzfIO6hfyUNMSGF4x4NGam0wp6jtr1U",{"logo":588,"freeTrial":593,"sales":598,"login":603,"items":608,"search":942,"minimal":974,"duo":993,"switchNav":1002,"pricingDeployment":1013},{"config":589},{"href":590,"dataGaName":591,"dataGaLocation":592},"/","gitlab logo","header",{"text":594,"config":595},"Get free trial",{"href":596,"dataGaName":597,"dataGaLocation":592},"https://gitlab.com/-/trial_registrations/new?glm_source=about.gitlab.com&glm_content=default-saas-trial/","free trial",{"text":599,"config":600},"Request a demo",{"href":601,"dataGaName":602,"dataGaLocation":592},"/request-a-demo/","sales",{"text":604,"config":605},"Sign in",{"href":606,"dataGaName":607,"dataGaLocation":592},"https://gitlab.com/users/sign_in/","sign in",[609,693,781,786,866,920],{"text":610,"left":143,"config":611,"menu":613},"Platform",{"dataNavLevelOne":612},"platform",{"type":24,"link":614,"columns":618,"feature":682},{"text":615,"config":616},"Explore the Platform",{"href":617,"dataGaName":612,"dataGaLocation":592},"/platform/",[619,641,664],{"title":583,"items":620},[621,626,631,636],{"text":622,"config":623},"CI/CD",{"href":624,"dataGaLocation":592,"dataGaName":625},"/solutions/continuous-integration/","ci/cd",{"text":627,"config":628},"Source Code Management",{"href":629,"dataGaLocation":592,"dataGaName":630},"/solutions/source-code-management/","source code management",{"text":632,"config":633},"Agile Delivery",{"href":634,"dataGaLocation":592,"dataGaName":635},"/solutions/agile-delivery/","agile delivery",{"text":637,"config":638},"Artifact Management",{"href":639,"dataGaLocation":592,"dataGaName":640},"/artifact-central/","artifact management",{"title":642,"items":643},"Security & Governance",[644,649,654,659],{"text":645,"config":646},"Application Security Testing",{"href":647,"dataGaLocation":592,"dataGaName":648},"/solutions/application-security-testing/","application security testing",{"text":650,"config":651},"Governance & Compliance",{"href":652,"dataGaLocation":592,"dataGaName":653},"/solutions/software-compliance/","governance and compliance",{"text":655,"config":656},"Secrets Management",{"href":657,"dataGaLocation":592,"dataGaName":658},"/gitlab-secrets-manager/","secrets management",{"text":660,"config":661},"Supply Chain Security",{"href":662,"dataGaLocation":592,"dataGaName":663},"/solutions/supply-chain/","supply chain security",{"title":665,"items":666},"Agentic AI & Context",[667,672,677],{"text":668,"config":669},"Duo Agent Platform",{"href":670,"dataGaLocation":592,"dataGaName":671},"/gitlab-duo-agent-platform/","duo agent platform",{"text":673,"config":674},"Orbit Context Graph",{"href":675,"dataGaLocation":592,"dataGaName":676},"/gitlab-orbit/","orbit",{"text":678,"config":679},"Visibility & Measurement",{"href":680,"dataGaLocation":592,"dataGaName":681},"/solutions/visibility-measurement/","visibility and measurement",{"config":683,"title":686,"text":687,"link":688},{"background":684,"textColor":685},"url('https://res.cloudinary.com/about-gitlab-com/image/upload/v1790185102/o7dn32anqcb6z8dgd3as.jpg')","#000","GitLab Orbit is generally available","Higher agent accuracy, lower token cost",{"text":689,"config":690},"Read the announcement",{"href":691,"dataGaName":692,"dataGaLocation":592},"/blog/gitlab-orbit-ga/","orbit ga announcement",{"text":694,"left":143,"config":695,"menu":697},"Solutions",{"dataNavLevelOne":696},"solutions",{"type":24,"link":698,"columns":702,"feature":772},{"text":699,"config":700},"View all Solutions",{"href":701,"dataGaName":696,"dataGaLocation":592},"/solutions/",[703,721,739],{"title":704,"items":705},"Outcomes",[706,711,716],{"text":707,"config":708},"DevOps Modernization",{"href":709,"dataGaLocation":592,"dataGaName":710},"/assessments/devops-modernization-assessment/","devops modernization",{"text":712,"config":713},"Security Modernization",{"href":714,"dataGaLocation":592,"dataGaName":715},"/assessments/security-modernization-assessment/","security modernization",{"text":717,"config":718},"AI Modernization",{"href":719,"dataGaLocation":592,"dataGaName":720},"/assessments/ai-modernization-assessment/","ai modernization",{"title":722,"items":723},"By size",[724,729,734],{"text":725,"config":726},"Enterprise",{"href":727,"dataGaLocation":592,"dataGaName":728},"/enterprise/","enterprise",{"text":730,"config":731},"Small Business",{"href":732,"dataGaLocation":592,"dataGaName":733},"/small-business/","small business",{"text":735,"config":736},"Startups",{"href":737,"dataGaLocation":592,"dataGaName":738},"/solutions/startups/","startups",{"title":740,"items":741},"Industries",[742,747,752,757,762,767],{"text":743,"config":744},"Financial Services",{"href":745,"dataGaLocation":592,"dataGaName":746},"/solutions/finance/","financial services",{"text":748,"config":749},"Public Sector",{"href":750,"dataGaLocation":592,"dataGaName":751},"/solutions/public-sector/","public sector",{"text":753,"config":754},"Telecommunications",{"href":755,"dataGaLocation":592,"dataGaName":756},"/solutions/telecommunications/","telecommunications",{"text":758,"config":759},"Automotive",{"href":760,"dataGaLocation":592,"dataGaName":761},"/solutions/automotive/","automotive",{"text":763,"config":764},"Education",{"href":765,"dataGaLocation":592,"dataGaName":766},"/solutions/education/","education",{"text":768,"config":769},"Aerospace",{"href":770,"dataGaLocation":592,"dataGaName":771},"/solutions/aerospace/","aerospace",{"config":773,"title":774,"text":775,"link":776},{"background":684,"textColor":685},"GitLab Security Standard","Learn how to harden your software factory and let AI agents earn autonomy, without trading away security.",{"text":777,"config":778},"Explore the standard",{"href":779,"dataGaName":780,"dataGaLocation":592},"/gitlab-security-standard/","gitlab security standard",{"text":782,"config":783},"Pricing",{"href":784,"dataGaName":785,"dataGaLocation":592,"dataNavLevelOne":785},"/pricing/","pricing",{"text":787,"config":788,"menu":790},"Resources",{"dataNavLevelOne":789},"resources",{"type":24,"link":791,"columns":795,"feature":857},{"text":792,"config":793},"View all resources",{"href":794,"dataGaName":789,"dataGaLocation":592},"/resources/",[796,829],{"title":797,"items":798},"Discover",[799,804,809,814,819,824],{"text":800,"config":801},"Docs",{"href":802,"dataGaName":803,"dataGaLocation":592},"https://docs.gitlab.com/","docs",{"text":805,"config":806},"University",{"href":807,"dataGaName":808,"dataGaLocation":592},"https://university.gitlab.com/","university",{"text":810,"config":811},"Demo Series",{"href":812,"dataGaName":813,"dataGaLocation":592},"/gitlab-technical-demo-series/","demo series",{"text":815,"config":816},"Demo Hub",{"href":817,"dataGaName":818,"dataGaLocation":592},"/demo-hub/","demo hub",{"text":820,"config":821},"Services",{"href":822,"dataGaName":823,"dataGaLocation":592},"/services/","services",{"text":825,"config":826},"Well Architected",{"href":827,"dataGaName":828,"dataGaLocation":592},"/resources/well-architected/","well architected",{"title":830,"items":831},"Connect",[832,837,842,847,852],{"text":833,"config":834},"Blog",{"href":835,"dataGaName":836,"dataGaLocation":592},"/blog/","blog",{"text":838,"config":839},"Community",{"href":840,"dataGaName":841,"dataGaLocation":592},"/community/","community",{"text":843,"config":844},"Customers",{"href":845,"dataGaName":846,"dataGaLocation":592},"/customers/","customers",{"text":848,"config":849},"Partners",{"href":850,"dataGaName":851,"dataGaLocation":592},"/partners/","partners",{"text":853,"config":854},"Events",{"href":855,"dataGaName":856,"dataGaLocation":592},"/events/","events",{"config":858,"title":859,"text":860,"link":861},{"background":684,"textColor":685},"What’s new in GitLab","Stay updated with our latest features and improvements.",{"text":862,"config":863},"Read the latest",{"href":864,"dataGaName":865,"dataGaLocation":592},"/whats-new/","whats new",{"text":867,"config":868,"menu":870},"Company",{"dataNavLevelOne":869},"company",{"type":24,"columns":871},[872],{"items":873},[874,879,885,890,895,900,905,910,915],{"text":875,"config":876},"About",{"href":877,"dataGaName":878,"dataGaLocation":592},"/company/","about",{"text":880,"config":881,"footerGa":884},"Jobs",{"href":882,"dataGaName":883,"dataGaLocation":592},"/jobs/","jobs",{"dataGaName":883},{"text":886,"config":887},"Press",{"href":888,"dataGaName":889,"dataGaLocation":592},"/press/","press",{"text":891,"config":892},"Handbook",{"href":893,"dataGaName":894,"dataGaLocation":592},"https://handbook.gitlab.com/","handbook",{"text":896,"config":897},"Leadership",{"href":898,"dataGaName":899,"dataGaLocation":592},"/company/team/e-group/","leadership",{"text":901,"config":902},"Investor relations",{"href":903,"dataGaName":904,"dataGaLocation":592},"https://ir.gitlab.com/overview/default.aspx","investor relations",{"text":906,"config":907},"Trust Center",{"href":908,"dataGaName":909,"dataGaLocation":592},"/security/","trust center",{"text":911,"config":912},"AI Transparency Center",{"href":913,"dataGaName":914,"dataGaLocation":592},"/ai-transparency-center/","ai transparency center",{"text":916,"config":917},"Newsletter",{"href":918,"dataGaName":919,"dataGaLocation":592},"/company/contact/#contact-forms","newsletter",{"text":921,"config":922,"menu":923},"Contact us",{"dataNavLevelOne":869},{"type":24,"columns":924},[925],{"items":926},[927,932,937],{"text":928,"config":929},"Talk to sales",{"href":930,"dataGaName":931,"dataGaLocation":592},"/sales/","talk to sales",{"text":933,"config":934},"Support portal",{"href":935,"dataGaName":936,"dataGaLocation":592},"https://support.gitlab.com/hc/en-us","support portal",{"text":938,"config":939},"Customer portal",{"href":940,"dataGaName":941,"dataGaLocation":592},"https://customers.gitlab.com/customers/sign_in/","customer portal",{"close":943,"login":944,"suggestions":951},"Close",{"text":945,"link":946},"To search repositories and projects, login to",{"text":947,"config":948},"gitlab.com",{"href":606,"dataGaName":949,"dataGaLocation":950},"search login","search",{"text":952,"default":953},"Suggestions",[954,957,960,962,966,970],{"text":955,"config":956},"GitLab Duo Agent Platform",{"href":670,"dataGaName":955,"dataGaLocation":950},{"text":958,"config":959},"Code Suggestions (AI)",{"href":670,"dataGaName":958,"dataGaLocation":950},{"text":622,"config":961},{"href":624,"dataGaName":622,"dataGaLocation":950},{"text":963,"config":964},"GitLab on AWS",{"href":965,"dataGaName":963,"dataGaLocation":950},"/partners/technology-partners/aws/",{"text":967,"config":968},"GitLab on Google Cloud",{"href":969,"dataGaName":967,"dataGaLocation":950},"/partners/technology-partners/google-cloud-platform/",{"text":971,"config":972},"Why GitLab?",{"href":973,"dataGaName":971,"dataGaLocation":950},"/why-gitlab/",{"freeTrial":975,"mobileIcon":980,"desktopIcon":985,"secondaryButton":988},{"text":976,"config":977},"Start free trial",{"href":978,"dataGaName":597,"dataGaLocation":979},"https://gitlab.com/-/trials/new/","nav",{"altText":981,"config":982},"Gitlab Icon",{"src":983,"dataGaName":984,"dataGaLocation":979},"https://res.cloudinary.com/about-gitlab-com/image/upload/v1758203874/jypbw1jx72aexsoohd7x.svg","gitlab icon",{"altText":981,"config":986},{"src":987,"dataGaName":984,"dataGaLocation":979},"https://res.cloudinary.com/about-gitlab-com/image/upload/v1758203875/gs4c8p8opsgvflgkswz9.svg",{"text":989,"config":990},"Get Started",{"href":991,"dataGaName":992,"dataGaLocation":979},"https://gitlab.com/-/trial_registrations/new?glm_source=about.gitlab.com/get-started/","get started",{"freeTrial":994,"mobileIcon":998,"desktopIcon":1000},{"text":995,"config":996},"Learn more about GitLab Duo",{"href":670,"dataGaName":997,"dataGaLocation":979},"gitlab duo",{"altText":981,"config":999},{"src":983,"dataGaName":984,"dataGaLocation":979},{"altText":981,"config":1001},{"src":987,"dataGaName":984,"dataGaLocation":979},{"button":1003,"mobileIcon":1008,"desktopIcon":1010},{"text":1004,"config":1005},"/switch",{"href":1006,"dataGaName":1007,"dataGaLocation":979},"#contact","switch",{"altText":981,"config":1009},{"src":983,"dataGaName":984,"dataGaLocation":979},{"altText":981,"config":1011},{"src":1012,"dataGaName":984,"dataGaLocation":979},"https://res.cloudinary.com/about-gitlab-com/image/upload/v1773335277/ohhpiuoxoldryzrnhfrh.png",{"freeTrial":1014,"mobileIcon":1019,"desktopIcon":1021},{"text":1015,"config":1016},"Back to pricing",{"href":784,"dataGaName":1017,"dataGaLocation":979,"icon":1018},"back to pricing","GoBack",{"altText":981,"config":1020},{"src":983,"dataGaName":984,"dataGaLocation":979},{"altText":981,"config":1022},{"src":987,"dataGaName":984,"dataGaLocation":979},{"title":1024,"button":1025,"config":1029},"GitLab Orbit is generally available. Increase agent accuracy and lower token cost",{"text":689,"config":1026},{"href":691,"dataGaName":1027,"dataGaLocation":1028},"orbit-ga-banner","global-banner",{"layout":1030,"disabled":571},"release",{"data":1032},{"text":1033,"config":1034,"items":1039,"minimal":1267},"Git is a trademark of Software Freedom Conservancy and our use of 'GitLab' is under license",{"twitter":1035,"facebook":1036,"youtube":1037,"linkedin":1038},"https://twitter.com/gitlab","https://www.facebook.com/gitlab","https://www.youtube.com/channel/UCnMGQ8QHMAnVIsI3xJrihhg","https://www.linkedin.com/company/gitlab-com",[1040,1088,1147,1194,1235],{"title":782,"links":1041,"subMenu":1057},[1042,1047,1052],{"text":1043,"config":1044},"View plans",{"href":784,"dataGaName":1045,"dataGaLocation":1046},"view plans","footer",{"text":1048,"config":1049},"Why Premium?",{"href":1050,"dataGaName":1051,"dataGaLocation":1046},"/pricing/premium/","why premium",{"text":1053,"config":1054},"Why Ultimate?",{"href":1055,"dataGaName":1056,"dataGaLocation":1046},"/pricing/ultimate/","why ultimate",[1058],{"title":1059,"links":1060},"Contact Us",[1061,1064,1066,1068,1073,1078,1083],{"text":1062,"config":1063},"Contact sales",{"href":930,"dataGaName":602,"dataGaLocation":1046},{"text":933,"config":1065},{"href":935,"dataGaName":936,"dataGaLocation":1046},{"text":938,"config":1067},{"href":940,"dataGaName":941,"dataGaLocation":1046},{"text":1069,"config":1070},"Status",{"href":1071,"dataGaName":1072,"dataGaLocation":1046},"https://status.gitlab.com/","status",{"text":1074,"config":1075},"Terms of use",{"href":1076,"dataGaName":1077,"dataGaLocation":1046},"/terms/","terms of use",{"text":1079,"config":1080},"Privacy statement",{"href":1081,"dataGaName":1082,"dataGaLocation":1046},"/privacy/","privacy statement",{"text":1084,"config":1085},"Cookie preferences",{"dataGaName":1086,"dataGaLocation":1046,"id":1087,"isOneTrustButton":143},"cookie preferences","ot-sdk-btn",{"title":610,"links":1089,"subMenu":1105},[1090,1093,1095,1097,1099,1101],{"text":1091,"config":1092},"Explore the platform",{"href":617,"dataGaName":612,"dataGaLocation":1046},{"text":668,"config":1094},{"href":670,"dataGaName":671,"dataGaLocation":1046},{"text":622,"config":1096},{"href":624,"dataGaName":625,"dataGaLocation":1046},{"text":673,"config":1098},{"href":675,"dataGaName":676,"dataGaLocation":1046},{"text":655,"config":1100},{"href":657,"dataGaName":658,"dataGaLocation":1046},{"text":1102,"config":1103},"Why GitLab",{"href":973,"dataGaName":1104,"dataGaLocation":1046},"why gitlab",[1106],{"title":1107,"links":1108},"Topics",[1109,1113,1118,1122,1127,1132,1137,1142],{"text":622,"config":1110},{"href":1111,"dataGaName":1112,"dataGaLocation":1046},"/topics/ci-cd/","cicd",{"text":1114,"config":1115},"GitOps",{"href":1116,"dataGaName":1117,"dataGaLocation":1046},"/topics/gitops/","gitops",{"text":583,"config":1119},{"href":1120,"dataGaName":1121,"dataGaLocation":1046},"/topics/devops/","devops",{"text":1123,"config":1124},"Version Control",{"href":1125,"dataGaName":1126,"dataGaLocation":1046},"/topics/version-control/","version control",{"text":1128,"config":1129},"DevSecOps",{"href":1130,"dataGaName":1131,"dataGaLocation":1046},"/topics/devsecops/","devsecops",{"text":1133,"config":1134},"Cloud Native",{"href":1135,"dataGaName":1136,"dataGaLocation":1046},"/topics/cloud-native/","cloud native",{"text":1138,"config":1139},"AI for Coding",{"href":1140,"dataGaName":1141,"dataGaLocation":1046},"/topics/devops/ai-for-coding/","ai for coding",{"text":1143,"config":1144},"Agentic AI",{"href":1145,"dataGaName":1146,"dataGaLocation":1046},"/topics/agentic-ai/","agentic ai",{"title":694,"links":1148},[1149,1152,1155,1158,1161,1164,1166,1168,1170,1172,1174,1177,1179,1182,1186,1190],{"text":1150,"config":1151},"DevOps modernization",{"href":709,"dataGaName":710,"dataGaLocation":1046},{"text":1153,"config":1154},"Security modernization",{"href":714,"dataGaName":715,"dataGaLocation":1046},{"text":1156,"config":1157},"AI modernization",{"href":719,"dataGaName":720,"dataGaLocation":1046},{"text":1159,"config":1160},"Financial services",{"href":745,"dataGaName":746,"dataGaLocation":1046},{"text":1162,"config":1163},"Public sector",{"href":750,"dataGaName":751,"dataGaLocation":1046},{"text":753,"config":1165},{"href":755,"dataGaName":756,"dataGaLocation":1046},{"text":758,"config":1167},{"href":760,"dataGaName":761,"dataGaLocation":1046},{"text":763,"config":1169},{"href":765,"dataGaName":766,"dataGaLocation":1046},{"text":768,"config":1171},{"href":770,"dataGaName":771,"dataGaLocation":1046},{"text":725,"config":1173},{"href":727,"dataGaName":728,"dataGaLocation":1046},{"text":1175,"config":1176},"Small business",{"href":732,"dataGaName":733,"dataGaLocation":1046},{"text":735,"config":1178},{"href":737,"dataGaName":738,"dataGaLocation":1046},{"text":1114,"config":1180},{"href":1181,"dataGaName":1117,"dataGaLocation":1046},"/solutions/gitops/",{"text":1183,"config":1184},"Software composition analysis",{"href":662,"dataGaName":1185,"dataGaLocation":1046},"software composition analysis",{"text":1187,"config":1188},"Value stream management",{"href":680,"dataGaName":1189,"dataGaLocation":1046},"value stream management",{"text":1191,"config":1192},"All solutions",{"href":701,"dataGaName":1193,"dataGaLocation":1046},"all solutions",{"title":787,"links":1195},[1196,1201,1206,1208,1210,1212,1214,1216,1218,1220,1222,1224,1226,1228,1231],{"text":1197,"config":1198},"Install",{"href":1199,"dataGaName":1200,"dataGaLocation":1046},"/install/","install",{"text":1202,"config":1203},"Quick start guides",{"href":1204,"dataGaName":1205,"dataGaLocation":1046},"/get-started/","quick setup checklists",{"text":800,"config":1207},{"href":802,"dataGaName":803,"dataGaLocation":1046},{"text":805,"config":1209},{"href":807,"dataGaName":808,"dataGaLocation":1046},{"text":810,"config":1211},{"href":812,"dataGaName":813,"dataGaLocation":1046},{"text":815,"config":1213},{"href":817,"dataGaName":818,"dataGaLocation":1046},{"text":820,"config":1215},{"href":822,"dataGaName":823,"dataGaLocation":1046},{"text":833,"config":1217},{"href":835,"dataGaName":836,"dataGaLocation":1046},{"text":838,"config":1219},{"href":840,"dataGaName":841,"dataGaLocation":1046},{"text":843,"config":1221},{"href":845,"dataGaName":846,"dataGaLocation":1046},{"text":848,"config":1223},{"href":850,"dataGaName":851,"dataGaLocation":1046},{"text":853,"config":1225},{"href":855,"dataGaName":856,"dataGaLocation":1046},{"text":916,"config":1227},{"href":918,"dataGaName":919,"dataGaLocation":1046},{"text":1229,"config":1230},"What's new",{"href":864,"dataGaName":865,"dataGaLocation":1046},{"text":1232,"config":1233},"All resources",{"href":794,"dataGaName":1234,"dataGaLocation":1046},"all resources",{"title":867,"links":1236},[1237,1239,1241,1243,1245,1247,1249,1251,1253,1257,1262],{"text":875,"config":1238},{"href":877,"dataGaName":869,"dataGaLocation":1046},{"text":880,"config":1240},{"href":882,"dataGaName":883,"dataGaLocation":1046},{"text":886,"config":1242},{"href":888,"dataGaName":889,"dataGaLocation":1046},{"text":891,"config":1244},{"href":893,"dataGaName":894,"dataGaLocation":1046},{"text":896,"config":1246},{"href":898,"dataGaName":899,"dataGaLocation":1046},{"text":901,"config":1248},{"href":903,"dataGaName":904,"dataGaLocation":1046},{"text":906,"config":1250},{"href":908,"dataGaName":909,"dataGaLocation":1046},{"text":911,"config":1252},{"href":913,"dataGaName":914,"dataGaLocation":1046},{"text":1254,"config":1255},"Sustainability",{"href":1256,"dataGaName":1254,"dataGaLocation":1046},"/sustainability/",{"text":1258,"config":1259},"Diversity, inclusion and belonging (DIB)",{"href":1260,"dataGaName":1261,"dataGaLocation":1046},"/diversity-inclusion-belonging/","Diversity, inclusion and belonging",{"text":1263,"config":1264},"Modern Slavery Transparency Statement",{"href":1265,"dataGaName":1266,"dataGaLocation":1046},"https://handbook.gitlab.com/handbook/legal/modern-slavery-act-transparency-statement/","modern slavery transparency statement",{"items":1268},[1269,1272,1275],{"text":1270,"config":1271},"Terms",{"href":1076,"dataGaName":1077,"dataGaLocation":1046},{"text":1273,"config":1274},"Cookies",{"dataGaName":1086,"dataGaLocation":1046,"id":1087,"isOneTrustButton":143},{"text":1276,"config":1277},"Privacy",{"href":1081,"dataGaName":1082,"dataGaLocation":1046},[1279],{"id":1280,"title":1281,"body":570,"config":1282,"content":1284,"description":570,"extension":1288,"meta":1289,"navigation":143,"path":1290,"seo":1291,"stem":1292,"__hash__":1293},"blogAuthors/en-us/blog/authors/pj-metz.yml","Pj Metz",{"template":1283},"BlogAuthor",{"name":7,"config":1285},{"headshot":1286,"ctfId":1287},"https://res.cloudinary.com/about-gitlab-com/image/upload/v1749659488/Blog/Author%20Headshots/gitlab-logo-extra-whitespace.png","PjMetz","yml",{},"/en-us/blog/authors/pj-metz",{},"en-us/blog/authors/pj-metz","SgW84Gu-lPq0zFzhy1aT23bZjx9kWViDG_WXzCPn04E",[1295,1303,1311],{"title":1296,"description":1297,"heroImage":1298,"category":566,"date":1299,"authors":1300,"slug":1302,"externalUrl":570},"Two front doors: Module-level access in a Django GRC app","A technical deep-dive on restructuring a Django internal tool to support two distinct GitLab teams: Security Compliance and Internal Audit.","https://res.cloudinary.com/about-gitlab-com/image/upload/v1750097663/Blog/Hero%20Images/Blog/Hero%20Images/Workflow%201800x945_2gQoQIbY9NvjLFpXtsxtXy_1750097663612.png","2026-10-05",[1301],"Donovan Felton","module-level-access-in-a-django-grc-app",{"title":1304,"description":1305,"heroImage":1306,"category":566,"date":1307,"authors":1308,"slug":1310,"externalUrl":570},"How GitLab reduced code-per-agentic-flow ratio by 45%","Learn how Flow Registry, a component-based framework that compiles YAML configurations into fully functional LangGraph flows, helped improve scalability and more.","https://res.cloudinary.com/about-gitlab-com/image/upload/v1774465167/n5hlvrsrheadeccyr1oz.png","2026-09-22",[1309],"Mikolaj Wawrzyniak","how-gitlab-reduced-code-per-agentic-flow-ratio",{"title":1312,"description":1313,"heroImage":1314,"category":566,"date":1315,"authors":1316,"slug":1318,"externalUrl":570},"Co-Create: Building GitLab with our users","How GitLab users collaborated with us to build practical product improvements in the first half of 2026.","https://res.cloudinary.com/about-gitlab-com/image/upload/v1750099203/Blog/Hero%20Images/Blog/Hero%20Images/blog-image-template-1800x945%20%2820%29_2bJGC5ZP3WheoqzlLT05C5_1750099203484.png","2026-09-10",[1317],"Isa Huerga","co-create-h1-2026",{"header":1320,"text":1321,"button":1325,"disclaimer":1328},"Start your free\n\n30-day GitLab trial\n",[1322,1323,1324],"GitLab Duo Agent Platform access","Try our most advanced features","Automate complex tasks with AI",{"text":594,"config":1326},{"href":1327,"dataGaName":597,"dataGaLocation":836},"https://gitlab.com/-/trials/new?glm_content=default-saas-trial&glm_source=about.gitlab.com/blog/","No credit card required.",{"header":1330,"blurb":1331,"button":1332,"secondaryButton":1337},"Start building faster today","See what your team can do with the intelligent orchestration platform for DevSecOps.\n",{"text":1333,"config":1334},"Get your free trial",{"href":1335,"dataGaName":597,"dataGaLocation":1336},"https://gitlab.com/-/trial_registrations/new?glm_content=default-saas-trial&glm_source=about.gitlab.com/","feature",{"text":1062,"config":1338},{"href":930,"dataGaName":602,"dataGaLocation":1336},1794911794600]