Necə

Python-da ilk proqram

İlk proqram bir sətirdir. Faylın adı salam.py olsun. İçində print("Salam") yaz. Bu, ekrana Salam çıxarır.

Python kompüterdə quraşdırılmalıdır. python.org-dan götür. Qurandan sonra terminalı aç. Faylın durduğu qovluğa keç və python salam.py yaz.

python tapılmırsa, quraşdırma yolu əlavə etməyib. Qurucunu yenidən aç və yolu əlavə etməyi seç. Başqa redaktor lazım deyil. Bir mətn faylı kifayətdir.

  • Windows-da əmr py salam.py da ola bilər.
  • Faylın sonu .py olmalıdır. .txt işləməz.
  • Dırnaq düz olmalıdır: "Salam". Əyri dırnaq səhv sayılır.
  • İkinci sətir ad = "Nibras" ola bilər. Sonra print(ad).
  • Səhv çıxsa, son sətri oxu. Orada sətrin nömrəsi yazılır.
  • Böyük layihə açma. Bir fayl işləyənə qədər orada qal.

Proqram heç nə yazmırsa, print yoxdur. Python faylı özü pəncərə açmır.

Əlaqəli bələdçilər

About this tool

This page is designed for beginners taking their first steps in programming. It explains how to write and run your first code using a simple text file without opening any complex projects. The main goal is to show users how basic commands operate on a computer.

People need these basics when starting to write code for the first time. The guide covers installing the software, opening the terminal, running the script, and getting results. Following basic rules helps avoid mistakes and achieve success right away.

How to use it

  1. Install Python on the computer and ensure the path is added.
  2. Create a text file named salam.py and write print("Hello") inside.
  3. Open the terminal and navigate to the folder where the file sits.
  4. Run the program by typing python salam.py.

Common uses

Frequently asked questions

What should the file extension be?

The file must end in .py. A .txt file will not run, so ensure the proper extension is used.

What if Python is not found?

If python is not found, the install did not add the path. Open the installer again and choose to add the path.

Why does the program write nothing?

If the program writes nothing, there is no print command included in the file.