[{"data":1,"prerenderedAt":842},["ShallowReactive",2],{"doc-\u002Flearn\u002Fwhat-is-python-a-beginner-friendly-introduction":3},{"id":4,"title":5,"body":6,"description":834,"extension":835,"meta":836,"navigation":837,"path":838,"seo":839,"stem":840,"__hash__":841},"content\u002Flearn\u002Fwhat-is-python-a-beginner-friendly-introduction.md","What Is Python? A Beginner-Friendly Introduction",{"type":7,"value":8,"toc":796},"minimark",[9,13,17,20,25,33,36,39,42,61,64,68,71,74,94,97,114,122,126,129,134,137,141,144,148,155,159,162,166,169,176,180,183,219,222,230,233,249,252,305,307,313,316,335,351,355,358,361,401,407,410,414,417,429,436,439,454,457,471,478,482,485,489,496,500,503,514,517,523,528,534,554,558,561,563,569,572,576,579,583,586,590,593,597,600,628,635,639,642,646,649,652,682,686,689,706,709,713,717,720,724,727,731,734,738,741,745,748,752,792],[10,11,5],"h1",{"id":12},"what-is-python-a-beginner-friendly-introduction",[14,15,16],"p",{},"Python is a beginner-friendly programming language used for many real tasks.",[14,18,19],{},"This page explains what Python is, why people use it, what makes it beginner-friendly, and what to learn next. If you are new to programming, this is a good place to start before moving on to installation, running code, and basic syntax.",[21,22,24],"h2",{"id":23},"what-python-is","What Python is",[14,26,27,28,32],{},"Python is a ",[29,30,31],"strong",{},"programming language",".",[14,34,35],{},"A programming language is a way to give instructions to a computer. You write those instructions as code, and the computer runs them.",[14,37,38],{},"Python is popular because its syntax is simple and readable. In other words, Python code often looks cleaner and easier to follow than code in many other languages.",[14,40,41],{},"Python is used by:",[43,44,45,49,52,55,58],"ul",{},[46,47,48],"li",{},"Complete beginners",[46,50,51],{},"Professional developers",[46,53,54],{},"Companies",[46,56,57],{},"Teachers and students",[46,59,60],{},"Researchers and analysts",[14,62,63],{},"That does not mean Python is only for simple practice. It is used for real software, automation, websites, data work, and more.",[21,65,67],{"id":66},"what-python-is-used-for","What Python is used for",[14,69,70],{},"Python is a general-purpose language. That means you can use it for many different kinds of programming.",[14,72,73],{},"Common uses include:",[43,75,76,79,82,85,88,91],{},[46,77,78],{},"Writing small scripts to automate repeated tasks",[46,80,81],{},"Building websites and web applications",[46,83,84],{},"Working with data, CSV files, and JSON",[46,86,87],{},"Making API requests and handling responses",[46,89,90],{},"Creating tools and command-line programs",[46,92,93],{},"Building beginner projects while learning programming fundamentals",[14,95,96],{},"For example, a Python program might:",[43,98,99,102,105,108,111],{},[46,100,101],{},"Rename many files automatically",[46,103,104],{},"Read a CSV file and summarize the data",[46,106,107],{},"Send a request to a web API and print the result",[46,109,110],{},"Power part of a website",[46,112,113],{},"Check input from a user and respond to it",[14,115,116,117,32],{},"If you want a broader overview, see ",[118,119,121],"a",{"href":120},"\u002Flearn\u002Fwhy-learn-python-use-cases-and-benefits\u002F","why learn Python: use cases and benefits",[21,123,125],{"id":124},"why-python-is-beginner-friendly","Why Python is beginner-friendly",[14,127,128],{},"Python is often recommended to beginners for practical reasons.",[130,131,133],"h3",{"id":132},"simple-syntax","Simple syntax",[14,135,136],{},"Python code is easier to read than many other languages. You can often understand the basic idea of a program even when you are new.",[130,138,140],{"id":139},"useful-results-with-a-small-amount-of-code","Useful results with a small amount of code",[14,142,143],{},"You do not need to write a large program before you can do something useful. Even a few lines can print text, work with numbers, or read a file.",[130,145,147],{"id":146},"large-standard-library","Large standard library",[14,149,150,151,154],{},"Python comes with many built-in tools. This collection is called the ",[29,152,153],{},"standard library",". It helps you do common tasks without installing extra packages right away.",[130,156,158],{"id":157},"lots-of-learning-resources","Lots of learning resources",[14,160,161],{},"Python has a large community. That means there are many tutorials, examples, guides, and answers available for beginners.",[130,163,165],{"id":164},"better-focus-on-problem-solving","Better focus on problem solving",[14,167,168],{},"Because the syntax is relatively clean, beginners can spend more time learning programming ideas and less time fighting complicated syntax.",[14,170,171,172,32],{},"After this page, a good next step is learning ",[118,173,175],{"href":174},"\u002Flearn\u002Fpython-syntax-basics-explained\u002F","Python syntax basics",[21,177,179],{"id":178},"what-python-code-looks-like","What Python code looks like",[14,181,182],{},"Here is a very small Python program:",[184,185,190],"pre",{"className":186,"code":187,"language":188,"meta":189,"style":189},"language-python shiki shiki-themes material-theme-lighter github-light github-dark","print(\"Hello, world!\")\n","python","",[191,192,193],"code",{"__ignoreMap":189},[194,195,198,202,206,210,214,216],"span",{"class":196,"line":197},"line",1,[194,199,201],{"class":200},"sptTA","print",[194,203,205],{"class":204},"sP7_E","(",[194,207,209],{"class":208},"sjJ54","\"",[194,211,213],{"class":212},"s_sjI","Hello, world!",[194,215,209],{"class":208},[194,217,218],{"class":204},")\n",[14,220,221],{},"Output:",[184,223,228],{"className":224,"code":226,"language":227,"meta":189},[225],"language-text","Hello, world!\n","text",[191,229,226],{"__ignoreMap":189},[14,231,232],{},"This example shows a few important ideas:",[43,234,235,238,243,246],{},[46,236,237],{},"Python code is read one line at a time",[46,239,240,242],{},[191,241,201],{}," is a built-in Python tool",[46,244,245],{},"The text inside quotes is a string",[46,247,248],{},"Parentheses hold the value you want to print",[14,250,251],{},"You can also write more than one line:",[184,253,255],{"className":186,"code":254,"language":188,"meta":189,"style":189},"name = \"Maya\"\nprint(\"Hello\")\nprint(name)\n",[191,256,257,276,292],{"__ignoreMap":189},[194,258,259,263,267,270,273],{"class":196,"line":197},[194,260,262],{"class":261},"su5hD","name ",[194,264,266],{"class":265},"smGrS","=",[194,268,269],{"class":208}," \"",[194,271,272],{"class":212},"Maya",[194,274,275],{"class":208},"\"\n",[194,277,279,281,283,285,288,290],{"class":196,"line":278},2,[194,280,201],{"class":200},[194,282,205],{"class":204},[194,284,209],{"class":208},[194,286,287],{"class":212},"Hello",[194,289,209],{"class":208},[194,291,218],{"class":204},[194,293,295,297,299,303],{"class":196,"line":294},3,[194,296,201],{"class":200},[194,298,205],{"class":204},[194,300,302],{"class":301},"slqww","name",[194,304,218],{"class":204},[14,306,221],{},[184,308,311],{"className":309,"code":310,"language":227,"meta":189},[225],"Hello\nMaya\n",[191,312,310],{"__ignoreMap":189},[14,314,315],{},"In this example:",[43,317,318,323,329],{},[46,319,320,322],{},[191,321,302],{}," is a variable",[46,324,325,328],{},[191,326,327],{},"\"Maya\""," is a string value",[46,330,331,334],{},[191,332,333],{},"print(name)"," prints the value stored in the variable",[14,336,337,338,341,342,346,347,32],{},"If ",[191,339,340],{},"variable"," is a new word for you, see ",[118,343,345],{"href":344},"\u002Fglossary\u002Fwhat-is-a-variable-in-python\u002F","what is a variable in Python"," or continue with ",[118,348,350],{"href":349},"\u002Flearn\u002Fpython-variables-explained-for-beginners\u002F","Python variables explained for beginners",[130,352,354],{"id":353},"indentation-matters-in-python","Indentation matters in Python",[14,356,357],{},"Python uses indentation to show blocks of code. Indentation usually means spaces at the start of a line.",[14,359,360],{},"For example:",[184,362,364],{"className":186,"code":363,"language":188,"meta":189,"style":189},"if 5 > 2:\n    print(\"5 is greater than 2\")\n",[191,365,366,385],{"__ignoreMap":189},[194,367,368,372,376,379,382],{"class":196,"line":197},[194,369,371],{"class":370},"sVHd0","if",[194,373,375],{"class":374},"srdBf"," 5",[194,377,378],{"class":265}," >",[194,380,381],{"class":374}," 2",[194,383,384],{"class":204},":\n",[194,386,387,390,392,394,397,399],{"class":196,"line":278},[194,388,389],{"class":200},"    print",[194,391,205],{"class":204},[194,393,209],{"class":208},[194,395,396],{"class":212},"5 is greater than 2",[194,398,209],{"class":208},[194,400,218],{"class":204},[14,402,403,404,406],{},"The indented line belongs to the ",[191,405,371],{}," statement.",[14,408,409],{},"If the indentation is missing or incorrect, Python may raise an error. This is one reason spacing matters more in Python than in some other languages.",[21,411,413],{"id":412},"how-python-runs-your-code","How Python runs your code",[14,415,416],{},"You can write Python code in two common ways:",[43,418,419,426],{},[46,420,421,422,425],{},"In a ",[191,423,424],{},".py"," file",[46,427,428],{},"In an interactive shell, where you type code and see the result immediately",[14,430,431,432,435],{},"When you run Python code, the ",[29,433,434],{},"Python interpreter"," reads your code and executes it.",[14,437,438],{},"You do not need deep technical details yet. For now, the important idea is simple:",[440,441,442,445,448,451],"ol",{},[46,443,444],{},"You write Python code",[46,446,447],{},"The interpreter reads it",[46,449,450],{},"Python runs the instructions",[46,452,453],{},"If something is wrong, Python shows an error",[14,455,456],{},"Errors happen when Python cannot understand your code or cannot complete an action. For example, this can happen if:",[43,458,459,462,465,468],{},[46,460,461],{},"You misspell something",[46,463,464],{},"You forget quotes or parentheses",[46,466,467],{},"You use bad indentation",[46,469,470],{},"You try to use a variable that does not exist yet",[14,472,473,474,32],{},"A practical next step is learning ",[118,475,477],{"href":476},"\u002Flearn\u002Fhow-to-run-python-code-command-line-and-ides","how to run Python code from the command line and IDEs",[21,479,481],{"id":480},"what-you-need-to-start-using-python","What you need to start using Python",[14,483,484],{},"You do not need much to begin.",[130,486,488],{"id":487},"_1-install-python","1. Install Python",[14,490,491,492,32],{},"First, install Python on your computer. If you have not done that yet, follow ",[118,493,495],{"href":494},"\u002Flearn\u002Fhow-to-install-python-on-windows-macos-and-linux","how to install Python on Windows, macOS, and Linux",[130,497,499],{"id":498},"_2-choose-a-way-to-write-code","2. Choose a way to write code",[14,501,502],{},"You can use:",[43,504,505,508,511],{},[46,506,507],{},"The command line",[46,509,510],{},"IDLE",[46,512,513],{},"An IDE such as VS Code or PyCharm",[14,515,516],{},"As a beginner, any of these can work. The best choice is usually the one that helps you write and run code easily.",[130,518,520,521,425],{"id":519},"_3-create-a-py-file","3. Create a ",[191,522,424],{},[14,524,525,526,32],{},"A Python file usually ends with ",[191,527,424],{},[14,529,530,531],{},"Example file: ",[191,532,533],{},"hello.py",[184,535,537],{"className":186,"code":536,"language":188,"meta":189,"style":189},"print(\"Hello from Python\")\n",[191,538,539],{"__ignoreMap":189},[194,540,541,543,545,547,550,552],{"class":196,"line":197},[194,542,201],{"class":200},[194,544,205],{"class":204},[194,546,209],{"class":208},[194,548,549],{"class":212},"Hello from Python",[194,551,209],{"class":208},[194,553,218],{"class":204},[130,555,557],{"id":556},"_4-run-the-file","4. Run the file",[14,559,560],{},"When you run the file, Python executes the code and shows the output.",[14,562,221],{},[184,564,567],{"className":565,"code":566,"language":227,"meta":189},[225],"Hello from Python\n",[191,568,566],{"__ignoreMap":189},[14,570,571],{},"Once you can do this, you are ready to move on to writing your first small programs.",[21,573,575],{"id":574},"what-python-is-not","What Python is not",[14,577,578],{},"Beginners often hear about Python in specific areas and get the wrong idea. Here are a few important clarifications.",[130,580,582],{"id":581},"python-is-not-only-for-data-science","Python is not only for data science",[14,584,585],{},"Python is used in data science, but that is only one part of what it can do. It is also used for scripting, automation, websites, APIs, testing, and general programming.",[130,587,589],{"id":588},"python-is-not-only-for-experts","Python is not only for experts",[14,591,592],{},"Python is widely used by beginners because it is easier to read than many other languages.",[130,594,596],{"id":595},"python-is-not-the-same-as-a-library-framework-or-ide","Python is not the same as a library, framework, or IDE",[14,598,599],{},"These are different things:",[43,601,602,608,615,621],{},[46,603,604,607],{},[29,605,606],{},"Python"," is the language",[46,609,610,611,614],{},"A ",[29,612,613],{},"library"," is code you can use in your program",[46,616,610,617,620],{},[29,618,619],{},"framework"," is a larger tool for building certain kinds of applications",[46,622,623,624,627],{},"An ",[29,625,626],{},"IDE"," is a program for writing and running code",[14,629,630,631,634],{},"For example, Python is the language, while VS Code is an editor and ",[191,632,633],{},"pip"," is a package tool.",[130,636,638],{"id":637},"learning-python-does-not-require-advanced-math","Learning Python does not require advanced math",[14,640,641],{},"For basic programming, you do not need advanced math. You mainly need practice, patience, and a willingness to solve problems step by step.",[21,643,645],{"id":644},"best-next-steps-after-this-page","Best next steps after this page",[14,647,648],{},"After learning what Python is, the best next move is to start using it.",[14,650,651],{},"A simple path is:",[440,653,654,659,664,670,675],{},[46,655,656],{},[118,657,658],{"href":494},"Install Python on your computer",[46,660,661],{},[118,662,663],{"href":476},"Learn how to run Python code",[46,665,666],{},[118,667,669],{"href":668},"\u002Flearn\u002Fyour-first-python-program-hello-world-explained\u002F","Write your first Python program",[46,671,672,673],{},"Learn ",[118,674,175],{"href":174},[46,676,677,678],{},"Continue with ",[118,679,681],{"href":680},"\u002Flearn\u002Fpython-data-types-overview\u002F","Python data types overview",[21,683,685],{"id":684},"common-mistakes-and-misunderstandings","Common mistakes and misunderstandings",[14,687,688],{},"These are common beginner misunderstandings about Python:",[43,690,691,694,700,703],{},[46,692,693],{},"Thinking Python is only for one field such as AI or data science",[46,695,696,697,699],{},"Confusing Python the language with tools like ",[191,698,633],{},", IDLE, or VS Code",[46,701,702],{},"Expecting to understand all Python features before writing any code",[46,704,705],{},"Believing simple syntax means Python is only for simple programs",[14,707,708],{},"A better approach is to start small, run simple code, and learn new ideas as you need them.",[21,710,712],{"id":711},"faq","FAQ",[130,714,716],{"id":715},"is-python-good-for-complete-beginners","Is Python good for complete beginners?",[14,718,719],{},"Yes. Python is widely used for learning because its syntax is easier to read and beginners can build useful programs quickly.",[130,721,723],{"id":722},"what-can-i-build-with-python","What can I build with Python?",[14,725,726],{},"You can build scripts, file tools, websites, APIs, data-processing programs, and many beginner projects.",[130,728,730],{"id":729},"do-i-need-to-install-python-before-learning-it","Do I need to install Python before learning it?",[14,732,733],{},"You can read examples without installing it, but you should install Python soon so you can practice by running code.",[130,735,737],{"id":736},"is-python-a-good-language-for-jobs","Is Python a good language for jobs?",[14,739,740],{},"Yes. Python is used in web development, automation, testing, data work, and many other real-world areas.",[130,742,744],{"id":743},"is-python-only-used-for-data-science","Is Python only used for data science?",[14,746,747],{},"No. It is also used for scripting, web development, APIs, automation, file handling, and general programming.",[21,749,751],{"id":750},"see-also","See also",[43,753,754,759,764,769,774,779,783,787],{},[46,755,756],{},[118,757,758],{"href":120},"Why learn Python: use cases and benefits",[46,760,761],{},[118,762,763],{"href":494},"How to install Python on Windows, macOS, and Linux",[46,765,766],{},[118,767,768],{"href":476},"How to run Python code from the command line and IDEs",[46,770,771],{},[118,772,773],{"href":668},"Your first Python program: Hello World explained",[46,775,776],{},[118,777,778],{"href":174},"Python syntax basics explained",[46,780,781],{},[118,782,350],{"href":349},[46,784,785],{},[118,786,681],{"href":680},[46,788,789],{},[118,790,791],{"href":344},"What is a variable in Python?",[793,794,795],"style",{},"html pre.shiki code .sptTA, html code.shiki .sptTA{--shiki-light:#6182B8;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sP7_E, html code.shiki .sP7_E{--shiki-light:#39ADB5;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sjJ54, html code.shiki .sjJ54{--shiki-light:#39ADB5;--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .s_sjI, html code.shiki .s_sjI{--shiki-light:#91B859;--shiki-default:#032F62;--shiki-dark:#9ECBFF}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}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 .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .su5hD, html code.shiki .su5hD{--shiki-light:#90A4AE;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .smGrS, html code.shiki .smGrS{--shiki-light:#39ADB5;--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .slqww, html code.shiki .slqww{--shiki-light:#6182B8;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sVHd0, html code.shiki .sVHd0{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#D73A49;--shiki-default-font-style:inherit;--shiki-dark:#F97583;--shiki-dark-font-style:inherit}html pre.shiki code .srdBf, html code.shiki .srdBf{--shiki-light:#F76D47;--shiki-default:#005CC5;--shiki-dark:#79B8FF}",{"title":189,"searchDepth":278,"depth":278,"links":797},[798,799,800,807,810,811,818,824,825,826,833],{"id":23,"depth":278,"text":24},{"id":66,"depth":278,"text":67},{"id":124,"depth":278,"text":125,"children":801},[802,803,804,805,806],{"id":132,"depth":294,"text":133},{"id":139,"depth":294,"text":140},{"id":146,"depth":294,"text":147},{"id":157,"depth":294,"text":158},{"id":164,"depth":294,"text":165},{"id":178,"depth":278,"text":179,"children":808},[809],{"id":353,"depth":294,"text":354},{"id":412,"depth":278,"text":413},{"id":480,"depth":278,"text":481,"children":812},[813,814,815,817],{"id":487,"depth":294,"text":488},{"id":498,"depth":294,"text":499},{"id":519,"depth":294,"text":816},"3. Create a .py file",{"id":556,"depth":294,"text":557},{"id":574,"depth":278,"text":575,"children":819},[820,821,822,823],{"id":581,"depth":294,"text":582},{"id":588,"depth":294,"text":589},{"id":595,"depth":294,"text":596},{"id":637,"depth":294,"text":638},{"id":644,"depth":278,"text":645},{"id":684,"depth":278,"text":685},{"id":711,"depth":278,"text":712,"children":827},[828,829,830,831,832],{"id":715,"depth":294,"text":716},{"id":722,"depth":294,"text":723},{"id":729,"depth":294,"text":730},{"id":736,"depth":294,"text":737},{"id":743,"depth":294,"text":744},{"id":750,"depth":278,"text":751},"Master what is python a beginner friendly introduction in our comprehensive Python beginner guide.","md",{},true,"\u002Flearn\u002Fwhat-is-python-a-beginner-friendly-introduction",{"title":5,"description":834},"learn\u002Fwhat-is-python-a-beginner-friendly-introduction","w9QKHHM5vsTRNUJrYIqNt6PgqZh_1l7HF9vn7FZuVd8",1777585474768]