Neler yapabileceksin
- Install Python and run a first program from the terminal or an editor
- Create variables and choose appropriate data types for numbers, strings, and booleans
- Write conditionals and loops to control program flow
- Use lists, tuples, and dictionaries to store and organize data
- Define and call functions with parameters and return values
- Build a small complete Python program that combines these concepts
Önce bilmen iyi olur
- Basic comfort using a computer and opening files
- Ability to install software or follow setup instructions
Müfredat
8 ders ve bir final projesi
- 1
Setting up Python and writing a first program Ücretsiz
You will install Python and PyCharm, create a project and a Python file, and run your first lines of code with print(). You will also see how a variable stores a value that print() can show.
2 kod7 adım2 alıştırma3 soru - 2
Variables and data types Beyond Pass
Bu derste değişkenlerde değer saklamayı, Python'un temel veri türlerini (tam sayılar, ondalıklı sayılar, metinler ve boolean değerler) ve kullanıcıdan girdi alıp bunu bir sayıya dönüştürmeyi öğreneceksin. Dersin sonunda doğum yılını isteyen ve yaşı hesaplayan küçük bir program yazabiliyor olacaksın.
3 kod3 adım3 alıştırma3 soru - 3
Metinler ve kullanıcı girdisi alma Beyond Pass
Bu derste input() fonksiyonunun kullanıcıdan metin nasıl istediğini ve neden döndürdüğü her değerin bir string olduğunu öğreneceksin. Ayrıca string'leri float() ile sayıya, str() ile tekrar metne nasıl çevireceğini ve bir string'in metotlarının nokta ile nasıl kullanıldığını da öğreneceksin.
2 kod3 adım2 alıştırma3 soru - 4
Koşullar ve karşılaştırmalar Beyond Pass
Bu ders, Python'un metinleri ve sayıları in operatörü ve % kalan operatörü ile nasıl kontrol ettiğini ve bir kod satırında işlemlerin sırasını nasıl belirlediğini gösterir. Ayrıca += ve -= gibi kısa yazımlı (shorthand) operatörleri de gösterir.
2 kod3 adım2 alıştırma3 soru - 5
Conditions in Python: if, elif and the logic behind them Beyond Pass
This lesson shows how Python checks conditions with comparison and logical operators, and how if, elif and else choose which code runs. You will write and test small programs that make decisions based on a value.
3 kod3 formül3 adım2 alıştırma3 soru - 6
Conditionals in Practice: elif, else and a Weight Converter Beyond Pass
This lesson shows how to chain several conditions with elif and finish with a catch-all else. It then builds a small weight converter that asks for a value and a unit and picks the right calculation.
2 kod1 formül4 adım3 alıştırma4 soru - 7
Python'da Fonksiyon Yazma ve Çağırma Beyond Pass
Fonksiyonun ne olduğunu, def ile nasıl tanımlandığını ve nasıl çağrıldığını öğreneceksin. Bir fonksiyonun girdi (parametre) alabildiğini ve birçok kez yeniden kullanılabildiğini göreceksin.
2 kod2 adım3 alıştırma3 soru - 8
Sözlükler ve küçük bir mini proje Beyond Pass
Bu ders, videoda gösterilen liste ve demet (tuple) araçlarını kapsar: "in" ile üyelik kontrolü yapmak, for ile döngü kurmak, range kullanmak ve count() ile öğeleri saymak gibi. Ders, mini projenin başlangıcıyla biter. Bu bölümün metni kısa olduğu için ders, karelerde gösterilenlerle sınırlı kalır.
5 kod2 adım2 alıştırma3 soru
Final projesi
Cep Harcama Takipçisi: Eksiksiz bir Python konsol programı
Listeler, demetler ve sözlüklerde harcamaları saklayan, input() ile kullanıcıdan veri alan ve float() ile çeviren, if/elif/else ile karar veren ve fonksiyonlarla mantığı yeniden kullanan küçük bir komut satırı harcama takipçisi yap. Bu program, kursun tüm çıktılarını tek bir çalışan programda bir araya getirir; para için 6. dersteki ağırlık dönüştürücüsü tarzını izler. Sonuç, kursun küçük yapı taşlarının gerçek bir araca dönüşebileceğini gösterir.
7 görev Beyond Pass ile açılır.
Ücretsiz önizleme · 1. dersin tamamı
Setting up Python and writing a first program
You will install Python and PyCharm, create a project and a Python file, and run your first lines of code with print(). You will also see how a variable stores a value that print() can show.
Dersin komutlarını yaz, boz ve nedenini gör.
Kodu gerçek Python ve JavaScript ile çalıştır, değiştir.
Videonun yanında çiz ve yaz.
Fikir
To write Python you need two things: the Python interpreter, which runs your code, and an editor where you type it. The video installs Python from the official Python installer (on macOS it shows Python 3.8.1 for macOS 10.9 or later) and then installs PyCharm Community Edition, a free editor made for Python. You drag PyCharm into the Applications folder like any other Mac app.
Next, open PyCharm and create a new project, here named HelloWorld. A project is a folder that holds your Python files. Inside it, right-click the project and choose New, then Python file. Name the file app.py. The .py ending tells the computer this file contains Python code.
Your first program is one line: print("Hello World"). The word print is a built-in instruction that shows whatever you put inside the brackets on the screen. The text inside the quotation marks is a string, which is a piece of text. Run the program from the Run menu (Run...), and the output Hello World appears in the panel at the bottom.
Print can also show a value stored in a variable. A variable is a name that holds a value. The line age = 20 creates a variable called age and stores the number 20 in it. The line print(age) then shows 20. Notice the difference: print("age") would show the word age, while print(age) shows the value stored under that name.
In short, you install Python and an editor, make a project and a .py file, write instructions, and run them. Each run executes the file from top to bottom, one line after another.
Ana noktalar
- Python needs an interpreter (installed from the Python installer) and an editor such as PyCharm Community Edition. 1:51
- A project is a folder for your files; a Python file ends with .py, for example app.py. 4:00
- print("Hello World") shows the text Hello World; the text inside the quotes is a string. 5:01
- Run... in the Run menu executes the file, and the output appears at the bottom of the window. 5:01
- print(age) shows the value stored in the variable age, which is 20 after age = 20. 6:40
Ekrandaki kod
print("Hello World")Save as app.py in your PyCharm project and press Run.
age = 20
print(age)Save as app.py in your PyCharm project and press Run.
Alıştırma terminalinde birlikte yap
- Download and run the Python installer from python.org and click Continue through the steps until it finishes. 1:51Göreceğin: Python is installed on your computer.
- Drag PyCharm CE into the Applications folder, then open PyCharm. 3:01Göreceğin: PyCharm opens and is ready to create a project.
- Create a new project called HelloWorld. 4:00Göreceğin: The HelloWorld project appears in the Project panel.
- Right-click the project, choose New, then Python file, and name it app.py. 4:00Göreceğin: app.py opens in the editor.
- Type print("Hello World") into app.py. 5:01Göreceğin: The line is shown in the editor.
$ print("Hello World") - Choose Run from the Run menu (or press the run button). 5:01Göreceğin: The output Hello World appears at the bottom.
- Replace the code with age = 20 and print(age), then run again. 6:40Göreceğin: The output shows 20.
$ print(age)
Alıştırma
Create a variable called name that stores the text "Sara" and print it.
# Write your code below
İpucu
Strings go in quotes. A variable is made with name = value, and print(name) shows its value.
Çözüm
- Create the variable: name = "Sara".
- Print the variable: print(name).
- Running it shows Sara (no quotes, because print shows the value).
name = "Sara"
print(name)Sara
A file has these lines: age = 20, then print(age), then age = 25, then print(age). What are the two numbers printed, added together?
İpucu
Lines run from top to bottom, so the second print sees the new value of age.
Çözüm
- The first print(age) runs when age is 20, so it prints 20.
- Then age becomes 25, and the second print(age) prints 25.
- 20 + 25 = 45.
45
Karalama defterinde
Draw a box labelled age, and write 20 inside it. Next to it, sketch what print(age) puts on the screen.
Test
What does the file ending .py tell the computer?
- The file is a picture
- The file contains Python code
- The file is a folder
- The file is encrypted
Cevabı göster
B. The file contains Python code · Files ending in .py hold Python code that the interpreter can run.
4:00 o anı izleAfter age = 20, what does print(age) show?
- age
- 20
- age = 20
- an error
Cevabı göster
B. 20 · print(age) shows the value stored in the variable age, which is 20.
6:40 o anı izleWhich editor does the video install to write Python?
- Word
- PyCharm Community Edition
- Excel
- Photoshop
Cevabı göster
B. PyCharm Community Edition · The video installs PyCharm Community Edition, a free Python editor.
3:01 o anı izle
2–8. dersler ve final projesi
Beyond Pass ile açılırlar: her kursun her dersi, eksiksiz. Tek ödeme: 90 gün için $14.99 ya da bir yıl için $29. Abonelik yok.
Beyond, Programming with Mosh kanalının “Python for Beginners - Learn Coding with Python in 1 Hour” videosundan yaptı. Video YouTube’un kendi oynatıcısında oynar. YouTube’da izle · Bütün dersler
