Informatics and programming for school, DİM and beginners
Short answers on number systems, units of information, algorithms, logic, Excel, networks and databases. Plus how to start programming from zero in Python, HTML and other languages, find bugs in your code and use AI the right way.
- How do I prepare for the DİM informatics exam?
- What are number systems?
- How do I convert a decimal number to binary?
- How do I convert binary to decimal?
- What are the octal and hexadecimal systems?
- What are the units of information?
- What is the difference between a bit and a byte?
- What is an algorithm?
- How do I draw a flowchart?
- How do the logic gates AND, OR and NOT work?
- How do I build a truth table?
- What are the main parts of a computer?
- What are computer networks?
- How does the internet work?
- What is a database?
- What are the basic Excel formulas?
- How do I use the IF function in Excel?
- How can I learn programming from zero?
- Which programming language should I start with?
- What is Python and what is it used for?
- How can I learn Python in Azerbaijani?
- How do I write a program in Pascal?
- Is C++ hard to learn?
- What is HTML?
- How do I make a website with HTML and CSS?
- What is JavaScript for?
- What is SQL and how do I write a query?
- Which AI writes code?
- Can I write code with AI?
- Can I learn programming with AI?
- Can AI find the bug in my code?
- Why doesn't my code work?
- Can AI explain code?
- Can AI run the code it writes?
- Can I build a website with AI?
- Can AI make a game?
- How do I write a Telegram bot?
- Can AI help me become a programmer?
- Will AI replace programmers?
- How do I prepare for a programming olympiad?
- How does the informatics olympiad work?
- How do I solve informatics problems?
- Where can I find DİM-format informatics tests?
- Which informatics topics come up in the final exam?
- What is Git and why do I need it?
- What is an API and how does it work?
- Where can I learn programming for free?
- Do I need math for programming?
- What software do I need to write code?
- Can I write code on my phone?
- What should I learn to get into computer science?
- What is cybersecurity and how do I learn it?
- What is a computer virus?
- What do file formats like PDF, DOCX and JPG mean?
- How do for and while loops work in Python?
- Which projects should I start with when learning to code?
How do I prepare for the DİM informatics exam?
Start with the informatics admission exam programme on dim.gov.az. It covers information processes and information security, encoding and measuring information, number systems, modelling, hardware and software, word processors and spreadsheets, databases, algorithms, programming in Python, computer networks, the internet, HTML and CSS. Work topic by topic, theory first and then problems on it, with a timed mixed test once a week. The programme is based on the grade 5 to 11 informatics textbooks, so they are your main source, and since the exam model can change, keep an eye on DİM's current announcements.
Guide: preparing for the DİM exam with AI →What are number systems?
A number system is a way of writing numbers with digits. In non-positional systems a digit means the same wherever it stands (in Roman numerals X is always 10), while in positional systems its value depends on its place: in 333 the threes mean 300, 30 and 3. The base of a positional system is the number of digits it uses: 10 in decimal (0–9), 2 in binary (0 and 1), 8 in octal and 16 in hexadecimal. Computers work in binary internally because their circuits most easily tell two states apart: signal or no signal.
How do I convert a decimal number to binary?
Divide the number by 2 again and again, writing down each remainder until the quotient reaches 0, then read the remainders from the bottom up. For 25: 25 ÷ 2 = 12 remainder 1, 12 ÷ 2 = 6 r 0, 6 ÷ 2 = 3 r 0, 3 ÷ 2 = 1 r 1, 1 ÷ 2 = 0 r 1, so 25₁₀ = 11001₂. Check by converting back: 16 + 8 + 1 = 25. For small numbers there's a quicker way: write the number as a sum of powers of two (16, 8, 4, 2, 1), then put 1 for each power you used and 0 for the rest.
Guide: explain school topics simply with AI →How do I convert binary to decimal?
Number the digits from right to left starting at 0, multiply each digit by 2 to the power of its position and add up the results. For example, 101101₂ = 1×32 + 0×16 + 1×8 + 1×4 + 0×2 + 1×1 = 45. In practice you only need to add the place values where there's a 1: 32 + 8 + 4 + 1. The same method works in any positional system; just use that system's base instead of 2.
What are the octal and hexadecimal systems?
Octal uses the digits 0–7, and hexadecimal uses 0–9 plus the letters A–F for the values 10 to 15. Both are handy because they map straight onto binary: one octal digit equals exactly three binary digits, and one hex digit equals four. For example, splitting 101101₂ into threes from the right gives 101 101 = 55₈, and into fours gives 0010 1101 = 2D₁₆; both equal 45 in decimal. Hex is everywhere in programming: on the web, #FF0000 is the code for red.
What are the units of information?
The smallest unit is the bit, a single binary digit (0 or 1), and 8 bits make 1 byte. In school informatics each next unit is 1024 times bigger than the one before: 1 KB = 1024 bytes, 1 MB = 1024 KB, 1 GB = 1024 MB, 1 TB = 1024 GB. Drive makers and some standards treat “kilo” as 1000, which is why some operating systems show a 1 TB drive as slightly less. In problems, check which definition is meant; textbooks usually use 1024.
What is the difference between a bit and a byte?
A bit is the smallest unit of information and holds one of two values, 0 or 1, while a byte is 8 bits and can store 2⁸ = 256 different values. File sizes are usually given in bytes (KB, MB, GB) and internet speeds in bits (Mbps). So a 100 Mbps connection downloads at most about 12.5 MB per second: divide by 8. In abbreviations a lowercase “b” means bit and an uppercase “B” means byte.
What is an algorithm?
An algorithm is a precise, ordered set of steps that leads to the solution of a problem: a recipe for tea and a program that finds the larger of two numbers are both algorithms. A good algorithm is made of separate steps, each step is clear and unambiguous, it finishes after a finite number of steps, and it works for a whole class of similar problems. By structure, algorithms are linear, branching (with conditions) or looping. You can write one in words, as a flowchart or in a programming language.
How do I draw a flowchart?
Each step in a flowchart has its own shape, and arrows connect the shapes: an oval for start and end, a parallelogram for input and output, a rectangle for a calculation or action, and a diamond for a condition. A diamond has two exits, yes and no, and a loop is shown by an arrow that goes back to a condition. Write the algorithm in words first, turn each step into the matching shape, then “run” the chart by hand with a couple of numbers to check it. Ask OrujovAI for a flowchart of your algorithm and it draws one as a diagram right in the chat.
Draw a flowchart in the chat →How do the logic gates AND, OR and NOT work?
A logic gate is a simple circuit that turns input signals of 0 and 1 into one output signal. AND outputs 1 only when all its inputs are 1, OR outputs 1 when at least one input is 1, and NOT flips its input, turning 1 into 0 and 0 into 1. An everyday example: you can board a plane only with a ticket AND a passport, but you can pay in cash OR by card. Every calculation a processor makes is built from huge numbers of these gates.
How do I build a truth table?
First count the variables: n variables give 2ⁿ rows (two give 4 rows, three give 8). Fill the rows with every combination of 0s and 1s in binary counting order (00, 01, 10, 11), then evaluate the expression piece by piece in order of precedence: brackets, then NOT, then AND, then OR. Give each intermediate result its own column; for A AND (NOT B), for example, fill in the NOT B column first. The last column holds the value of the whole expression.
What are the main parts of a computer?
At the heart of a computer is the processor (CPU), which carries out the instructions of programs. RAM holds the data currently being worked on and is cleared when the computer switches off, while a hard drive (HDD) or SSD stores files permanently. These parts connect through the motherboard; the keyboard, mouse, microphone and scanner are input devices, and the monitor, printer and speakers are output devices. The power supply, graphics card and ports complete the picture.
What are computer networks?
A computer network is a group of connected computers and devices that exchange data and share resources such as files, printers and internet access. By size there are local networks (LAN, like a school computer lab), metropolitan networks (MAN) and wide area networks (WAN); the internet is the largest WAN of all. The layout of the connections is called the topology: bus, ring, star or mixed, and most homes use a star, with every device connected to one router. Wi-Fi and Bluetooth are examples of wireless technologies.
How does the internet work?
The internet is a vast set of connected networks that talk to each other using shared rules, the TCP/IP protocols. Every device on it has an IP address, and when you type a website's name, a DNS server translates it into that address. Data is split into small packets, routers send each packet along a suitable path, and the packets are put back together at the other end. Websites load over HTTP or its encrypted version HTTPS, so “https” in the address means the connection is encrypted.
What is a database?
A database is an organised collection of information stored so that it's easy to search, sort and update. The most common kind is relational: data sits in tables where each row is a record (say, one student) and each column is a field (name, class, score), and tables link to each other through key fields. A database management system (DBMS) such as Microsoft Access, MySQL or PostgreSQL runs it, and you get data out with queries, usually written in SQL. Behind almost every banking app, online shop or school e-register there is a database.
What are the basic Excel formulas?
Every Excel formula starts with an equals sign, for example =A1+B1. The functions you'll use most are SUM, AVERAGE, MIN and MAX, COUNT (how many cells contain numbers) and IF (a condition); =SUM(B2:B10), for instance, adds up the cells from B2 to B10. When you drag a formula down, its cell references shift (relative references), the $ sign locks them ($A$1 is an absolute reference), and a mixed reference such as $A1 locks only one part. Some language versions translate the function names: in Russian Excel, SUM becomes СУММ.
How do I use the IF function in Excel?
IF checks a condition and returns one result when it's true and another when it's false: =IF(condition, value_if_true, value_if_false). For example, =IF(B2>=50, "Pass", "Fail") shows “Pass” when B2 holds 50 or more and “Fail” otherwise. For three or more outcomes, such as excellent, good and satisfactory, you nest another IF inside the first one. Text always goes in quotes, and depending on your regional settings the separator is a comma or a semicolon.
How can I learn programming from zero?
Pick one language (Python is the easiest start for most people) and learn the basics in order: variables, input and output, conditions, loops, lists and functions. After each topic, write and run the code yourself, because you learn programming by making mistakes and fixing them, not by watching videos. Thirty to sixty minutes of steady practice a day beats one long session a week. After a month or two, take on a small but finished project that pulls together what you've learned, such as a program that works out the average mark in a class register.
Guide: an AI tutor for students →Which programming language should I start with?
If you don't have a specific goal yet, start with Python: its syntax is simple, its error messages are readable, and it's the language taught in DİM's informatics programme. If you want to build websites, begin with HTML and CSS and then move on to JavaScript; if you're aiming at olympiads, learn C++. Your first language matters less than it seems, because variables, conditions, loops and functions work the same way everywhere, and your second language comes much faster.
What is Python and what is it used for?
Python is a free, general-purpose programming language with a simple, readable syntax. It's used for the server side of websites, data analysis and charts, machine learning and AI models, automating chores (renaming hundreds of files, building spreadsheets), Telegram bots and simple games. Its huge collection of libraries means there's a ready-made tool for almost any job. Because it's so approachable, schools and universities often choose it as a first language.
How can I learn Python in Azerbaijani?
Azerbaijani school informatics textbooks teach Python basics in Azerbaijani, and the Python section of DİM's admission programme is based on those same textbooks. There are also Azerbaijani-language Python lessons on YouTube and in local courses. The language's keywords (print, if, for) are English everywhere, so you only need to learn what those few words mean. You can ask OrujovAI to explain any line of code in Azerbaijani and then set you a small exercise on the same topic.
Ask the chat to explain Python →How do I write a program in Pascal?
A Pascal program has a header, a section that declares variables, and a main part between begin and end, with a full stop after the final end. The simplest example: program Hello; begin writeln('Hello, world!'); end. To add two numbers, declare them with var a, b: integer;, read them with readln(a, b); and print the sum with writeln(a + b);. Free environments such as Free Pascal or PascalABC.NET run it; note that DİM's current admission programme names Python as its programming language.
Is C++ hard to learn?
Compared with Python, a little: you declare every variable's type, the code has to be compiled first, and pointers and memory management confuse beginners. But the part you need for olympiad problems, meaning reading and printing data, conditions, loops, arrays and the ready-made STL containers, takes a few weeks of regular practice. C++ is fast, which is why it's popular in olympiads and game engines. If you've never programmed, learning the basics in Python first and then switching to C++ is easier.
What is HTML?
HTML (HyperText Markup Language) is the markup language that describes the structure of a web page: where the headings, text, images, lists, tables and links go. It does this with tags: <h1>Hello</h1> makes a heading, <p>...</p> a paragraph and <a href="...">...</a> a link. HTML is the page's skeleton, while CSS handles how it looks and JavaScript how it behaves. Strictly speaking it's a markup language rather than a programming language, since it has no conditions or loops, though school courses teach it together with CSS under web programming.
How do I make a website with HTML and CSS?
Create a folder with a file called index.html and write the page's structure: headings, text, images and links. Then set the colours, fonts and layout in a style.css file and connect it to the HTML with the line <link rel="stylesheet" href="style.css">. Open the file in a browser and refresh after each change; when it's ready, you can publish it for free on a service such as GitHub Pages. OrujovAI can write the HTML and CSS in the chat and explain every line, and on the Plus plan the page opens straight away in a live preview.
Write website code in the chat →What is JavaScript for?
JavaScript makes web pages interactive: buttons that react when clicked, form checks, drop-down menus, and games and maps in the browser all run on it. It works in every browser with nothing to install, and thanks to Node.js it also runs on servers. If HTML gives a page its structure and CSS its look, JavaScript controls its behaviour. For web development it's close to essential.
What is SQL and how do I write a query?
SQL is the language for working with databases: you use it to select, add, change and delete data. The core query is SELECT: SELECT name, score FROM students WHERE score >= 80 ORDER BY score DESC; lists the names and scores of students with 80 or more, highest first. INSERT INTO adds records, UPDATE changes them and DELETE removes them; leave out WHERE in an UPDATE or DELETE and the whole table changes. SQLite, a free database that's easy to set up, is a comfortable place to practise.
Which AI writes code?
Almost every major chatbot writes code today, including ChatGPT and OrujovAI: they generate it, explain it and help fix mistakes. There are also AI assistants built into code editors such as VS Code that complete code as you type. When choosing, check whether the tool explains its code, answers in your language and can run the code to test it. In OrujovAI, writing and explaining code is part of the Free plan, and running code in the chat comes with Plus.
Open the OrujovAI chat →Can I write code with AI?
Yes, and professional programmers do it every day. The result depends on how precisely you describe the task: the language, what goes in, what should come out, sample data and any limits. Always run the code and test it on different cases, because AI can write code that looks right but breaks on edge cases. Most importantly, understand what the code does; otherwise you won't be able to fix or extend it.
Can I learn programming with AI?
Yes, if you use AI as a teacher rather than an answer machine. Ask it to explain a topic simply, set you small exercises and review your code by pointing out the mistake, but make the fix yourself. After each new idea, explaining it back in your own words and asking whether you got it right helps it stick. OrujovAI's Live Tutor teaches a topic you choose as a narrated slideshow lesson and checks you with questions at the end.
Open Live Tutor →Can AI find the bug in my code?
Often, yes, especially syntax errors and problems the program reports with an error message. For the best result, share the full code, the exact error message and what you expected versus what you got. Logic errors, where the program runs but gives the wrong answer, are harder to find, and a concrete example of input data helps a lot. You can paste your code and the error into the OrujovAI chat and ask it to explain the cause step by step.
Check your code in the chat →Why doesn't my code work?
Start with the error message: the last line names the type of error (SyntaxError, NameError, TypeError and so on) and the lines above show where it happened. The most common beginner mistakes are a missing bracket or colon, wrong indentation in Python, a typo in a variable name, forgetting that input() returns text (use int(input()) for a number) and a loop that runs once too often or once too few times. If the code runs but the result is wrong, print the intermediate values to find the step where things go off track. Cutting the program down to the smallest example that still fails often reveals the bug by itself.
Can AI explain code?
Yes, it's one of the most useful things AI does: it can go through code line by line, say what each function does and show how it works on sample data. When something is unclear, ask follow-ups like “explain it more simply” or “what happens if I remove this line?”. With long code, ask for the overall logic first and then the individual parts. To check the explanation, change the code yourself and see whether the result changes the way you expected.
Can AI run the code it writes?
It depends on the tool: many chatbots only write code and leave running it to you. In OrujovAI, Python runs right in your browser and shows charts as images, JavaScript runs in a secure sandbox, and a complete HTML page opens in a live preview; running code this way is part of the Plus plan. In environments like these, code usually has no access to the internet or to files on your computer, so larger projects still need testing on your own machine.
Compare plans →Can I build a website with AI?
Yes: AI can write a simple site, such as a business card page, a portfolio or an event page, in HTML, CSS and JavaScript in a few minutes. Describe the site's purpose, sections, colours and text, then ask for changes one at a time. To put it online you need hosting (there are free options too) and, if you like, a domain name. If the site has sign-ups, payments or a database, have someone who understands security review the code.
Can AI make a game?
Small ones, yes: ask for a snake game, a Tetris-style game, a quiz or a simple browser platformer, and AI will write it in HTML and JavaScript over a few steps. In the OrujovAI chat, a small interactive game or tool like that can be built and played right inside the conversation. Big 3D games need engines such as Unity or Godot, art, sound and long teamwork, and there AI only helps with individual parts.
Build a game in the chat →How do I write a Telegram bot?
Message @BotFather in Telegram, create a bot with the /newbot command and you'll get a token, the bot's secret key. Then install a Python library such as python-telegram-bot or aiogram and write a short script that replies to messages, for example one that greets anyone who sends /start. The bot only answers while your code is running, so for round-the-clock use you host it on a server or in the cloud. Never share the token or publish it with your code: anyone who has it can control your bot.
Can AI help me become a programmer?
Yes, it speeds up learning a lot: it explains what you don't understand, reviews your code and sets exercises at your level. But employers look for solid fundamentals, the ability to solve problems on your own and real projects, and an interview may ask you to write code with no help at all. So write the code yourself, get comfortable with Git and put a few finished projects on GitHub. Knowing how to use AI tools well is itself a valuable skill for a programmer now.
Will AI replace programmers?
Short answer: it's changing the job, not abolishing it. AI already writes simple, repetitive code quickly, so more of the work shifts to framing problems well, designing systems, reviewing code and taking responsibility for the result. People who can only write boilerplate will face tougher competition, while programmers who understand the problem and use AI skilfully get more done. Nobody can predict the future exactly, but fundamentals and problem-solving skills keep their value.
How do I prepare for a programming olympiad?
First get really comfortable with one language: most olympiad competitors choose C++ because it's fast, and at some international olympiads it's the only language allowed, so check each contest's rules for the languages it accepts. Then learn the core algorithms: sorting, binary search, prefix sums, greedy methods, recursion, dynamic programming, graphs (BFS, DFS) and basic number theory. Solve problems regularly on platforms like Codeforces and enter timed contests, and when you can't solve a problem, read the editorial and then write the solution again yourself. Past olympiad problems show best what level is expected.
How does the informatics olympiad work?
In Azerbaijan the republican subject olympiad is held for students in grades 8 to 11, and informatics is one of its eight subjects. It runs in two stages: a district (city) stage and a republican stage made up of a semifinal and a final round. Informatics olympiads usually centre on algorithmic problems: you write the solution as a program and automatic tests check it, so it has to be both correct and fast enough to fit the time limit. Dates, registration and rules are announced each school year by the Ministry of Science and Education on edu.gov.az.
How do I solve informatics problems?
First work out the type of problem: number systems, amount of information, logic, an algorithm or code to trace, spreadsheets or networks. Each type has its own method; for the amount of information, for example, you use N = 2ⁱ (N is the size of the alphabet, i the number of bits per character) and I = K × i (K is the number of characters in the text). If you're given code or an algorithm, run it by hand, writing each variable's value at every step in a table, and check the answer by working backwards or on a small example. Watch the units (bits, bytes, KB) closely, because that's where most mistakes happen.
Guide: explain school topics simply with AI →Where can I find DİM-format informatics tests?
The most reliable source is DİM's own publications: the further-reading list of its informatics programme names a study guide and a test collection issued as supplements to the “Abituriyent” journal, plus a book of 20 practice exams that follow the admission exam model. OrujovAI's /exam section doesn't include informatics yet, but in Live Tutor you can create a practice quiz on any informatics topic. Practice quizzes don't replace DİM's official materials; they only help you check how well you know a topic.
Create a practice quiz →Which informatics topics come up in the final exam?
Informatics isn't one of the final (buraxılış) exam subjects: in both grade 9 and grade 11 the final exam covers the language of instruction, mathematics and a foreign language, and pupils whose language of instruction isn't Azerbaijani also sit Azerbaijani as the state language. The informatics exam is taken in the second stage of university admission by students who choose the Rİ subgroup of group I. Your school grade in informatics comes from assessments during the school year. You can look up each year's exam model on dim.gov.az.
Guide: preparing for the final exams at home →What is Git and why do I need it?
Git is a free version control system: it saves each change to your code as a commit, so you can go back to any earlier version and see what changed, when and who changed it. Branches let you try out a new feature without breaking the main code. Services such as GitHub and GitLab host Git repositories online and make teamwork easier. Start with the core commands: git init, git add, git commit and git push.
What is an API and how does it work?
An API (Application Programming Interface) is an agreed set of rules that lets one program talk to another: which requests it can send and what answers it gets back. A weather app, for example, sends a weather service's API a request like “today's weather in Baku” and gets the answer back, usually as JSON. It's like a waiter in a restaurant: you don't walk into the kitchen, you order from the menu and receive the finished dish. Many APIs require a key, which you should keep secret like a password.
Where can I learn programming for free?
There are plenty of good free resources: freeCodeCamp, Harvard's CS50, Khan Academy, MDN Web Docs for web technologies, the official Python documentation and your school informatics textbooks. If you read Russian, Stepik has free Python courses, and platforms such as Codeforces are free for practising problems. What matters most is picking one course, finishing it and applying what you learn in small projects. An AI chat can also explain the parts you don't understand, for free.
Guide: free AI tools in Azerbaijan →Do I need math for programming?
To start programming, school basics are enough: arithmetic, percentages, simple equations and logical thinking. Websites and ordinary apps rarely need advanced maths. Competitive programming, game physics and graphics, data analysis and AI, on the other hand, call for discrete maths, linear algebra, probability and statistics. Programming itself builds mathematical thinking, so a fear of maths is no reason not to start.
What software do I need to write code?
You need a code editor and a way to run your chosen language. For Python, install it from python.org and pick an editor: the free VS Code, or Thonny, which is simpler for beginners; for C++ you need a compiler (for example g++ via MinGW) or a ready-made IDE. For web pages, an editor and a browser are enough. In the first few days you can skip installing anything and use an online editor in your browser.
Can I write code on my phone?
For learning, yes: on Android there are Python apps such as Pydroid 3, and online editors for many languages run in the browser on any phone. A phone is fine for small exercises, practising loops and conditions, and reading code. For long code, several files and real projects, though, a computer, even an old and slow one, is far more comfortable.
What should I learn to get into computer science?
Computer science is in the Rİ subgroup of group I: the block exam covers mathematics (coefficient 1.5), physics (1.5) and informatics (1), and the first stage is the grade 11 final exam. Maths and physics carry more weight, so give them extra attention, and prepare informatics from DİM's programme. Admission scores are set anew by each year's competition, so treat past figures only as a rough guide and take the official numbers from DİM. Learning to write small Python programs before university is also a big advantage.
Guide: preparing for the DİM exam with AI →What is cybersecurity and how do I learn it?
Cybersecurity is protecting computers, networks, software and data from unauthorised access, theft and damage. Start with the foundations: computer networks, operating systems (especially Linux), one programming language such as Python, and how the web works. Then practise on legal training platforms such as picoCTF and TryHackMe. Never try to break into a system you don't have permission to test: it can be a criminal offence.
What is a computer virus?
A computer virus is a program that copies itself into other files or programs and harms the computer. Today people usually use the broader term malware, which also covers worms that spread across networks, trojans disguised as useful programs, spyware, and ransomware that encrypts your files and demands payment. To stay safe, keep your system and apps updated, keep antivirus switched on, don't download files or apps from unknown sources and don't click suspicious links. Backups of important files save your data even in the worst case.
What do file formats like PDF, DOCX and JPG mean?
A format describes how the data inside a file is stored, and you can usually tell it from the extension at the end of the file name. PDF keeps a document looking the same on any device and suits printing and sending, DOCX is an editable Microsoft Word document, and JPG is a compressed format for photos (it gives up a little quality to make the file smaller). Related ones: PNG stores images without loss and with transparent backgrounds, XLSX is an Excel spreadsheet, MP3 is audio and MP4 is video. To change a PDF, in OrujovAI's PDF editor you just write what you want changed.
Open the PDF editor →How do for and while loops work in Python?
A for loop walks through a known sequence: for i in range(1, 6): print(i) prints the numbers 1 to 5 (range stops before its end value), and for ch in "hello" goes through the word letter by letter. A while loop repeats as long as its condition is true: with n = 10, for example, the loop while n > 0: n = n - 3 runs four times and stops when n reaches -2. If nothing inside a while loop changes the condition, it never stops, so make sure the variable changes. Use for when you know how many repetitions you need and while when it depends on a condition; break leaves a loop early and continue jumps straight to the next repetition.
Which projects should I start with when learning to code?
Start with small projects you can finish in a few hours: a calculator, a guess-the-number game, a quiz, a to-do list or a password generator. Then build something useful to you: a personal web page, an expense tracker, a timetable or a simple Telegram bot. Improve each finished project by adding one feature, such as saving results to a file or a graphical interface. Put finished projects on GitHub: a few months later, looking back, you'll clearly see how far you've come.