PythonPython · Chapterبەش 4 · Lectureوانە 4.1

Variables and Data Typesگۆڕاوەکان و جۆرەکانی دراوە

Store values in variables: assignment with =, changing a value, Python's naming rules and PEP 8 style, the basic data types int, float, str, bool and None, type(), dynamic typing, and converting between types with int(), float() and str().

لە هەڵبگرە: بە =، گۆڕینی ، یاساکانی ناونانی Python و شێوازی ⁦PEP 8⁩، سەرەکییەکانی int، float، str، bool و None، type()، و بە int()، float() و str().

19 min read19 خولەک خوێندنەوە · 19 stepsهەنگاو

What you will learnچی فێر دەبیت

  • Explain what a variable is and create, read and change variables with assignment.
  • Choose valid, readable names that follow Python's rules and PEP 8.
  • Recognise the types int, float, str, bool and None and check them with type().
  • Explain dynamic typing and convert values with int(), float() and str().
  • ڕوونی بکەیتەوە چییە و بە دروست بکەیت، بیانخوێنیتەوە و بیانگۆڕیت.
  • ناوی دروست و ڕوون هەڵبژێریت کە یاساکانی Python و ⁦PEP 8⁩ پەیڕەو بکەن.
  • جۆرەکانی int، float، str، bool و None بناسیتەوە و بە type() بیانپشکنیت.
  • ڕوون بکەیتەوە و بە int()، float() و str() بگۆڕیت.

What is a variable?گۆڕاو چییە؟

Definitionپێناسە

A named place in that holds a ; the value can change while the program runs. In Python you simply write age = 20; in PHP the name starts with $ ($age = 20;).

شوێنێکی ناونراوە لەناو کە هەڵدەگرێت و دەتوانێت لە کاتی کارکردنی بگۆڕێت. لە Pythonـدا تەنها دەنووسیت age = 20؛ لە PHPـدا ناوەکە بە $ دەست پێ دەکات ($age = 20;).

Programs work with information: prices, names, marks. A stores a piece of information under a name, so the program can use it again and change it later. A good name also labels the data: tea_price tells every reader what the number 500 means, which makes the program easier to understand for others and for you.

کار لەگەڵ زانیاری دەکەن: نرخ، ناو، نمرە. پارچەیەک زانیاری لە ژێر ناوێکدا هەڵدەگرێت، بۆ ئەوەی بتوانێت دووبارە بەکاری بهێنێتەوە و دواتر بیگۆڕێت. ناوێکی باش وەک نووسراوێکە لەسەر : tea_price بە هەموو خوێنەرێک دەڵێت ژمارەی ⁦500⁩ چ واتایەکی هەیە، ئەمەش بۆ خەڵکی تر و بۆ خۆت ئاسانتر دەکات.

Compare two versions of the same program. The first repeats the price everywhere; in the second, the price has a name and the number of glasses can change.

دوو وەشانی هەمان بەراورد بکە. یەکەمیان نرخەکە لە هەموو شوێنێک دووبارە دەکاتەوە؛ لە دووەمیاندا نرخەکە ناوێکی هەیە و ژمارەی ئیستیکانەکان دەتوانێت بگۆڕێت.

without_variables.pyPYTHONType in a terminalلە تێرمیناڵدا بینووسە
print("3 glasses of tea cost", 3 * 500, "dinars")
print("5 glasses of tea cost", 5 * 500, "dinars")
with_variables.pyPYTHONType in a terminalلە تێرمیناڵدا بینووسە
tea_price = 500
glasses = 3
print(glasses, "glasses of tea cost", glasses * tea_price, "dinars")
glasses = 5
print(glasses, "glasses of tea cost", glasses * tea_price, "dinars")
Explain the codeڕوونکردنەوەی کۆدەکە
Lineدێڕی 1

If the price changes to 750, you change one line only.

ئەگەر نرخەکە بگۆڕێت بۆ ⁦750⁩، تەنها یەک دێڕ دەگۆڕیت.

Lineدێڕی 4

The same name now holds a new value.

هەمان ناو ئێستا نوێ هەڵدەگرێت.

Labelled jars in a spice shopقوتووی ناونووسکراو لە دوکانی بەهارات

Think of the jars in a spice shop at the bazaar. Each jar has a label (cumin, sumac) and holds something. The seller finds what he needs by its label, and can empty a jar and fill it with something new. A variable is a labelled container for one value.

قوتووەکانی دوکانێکی بەهارات لە بازاڕدا بهێنە بەرچاو. هەر قوتوویەک نووسراوێکی پێوەیە (زیرە، سماق) و شتێکی تێدایە. فرۆشیارەکە ئەوەی پێویستیەتی بە نووسراوەکەی دەدۆزێتەوە و دەتوانێت قوتوویەک بەتاڵ بکاتەوە و شتێکی نوێی تێ بکات. دەفرێکی ناونووسکراوە بۆ یەک .

Where the analogy stops workingسنووری ئەم نموونەیە

A jar holds one spice and never two jars share the same spice. In Python two names can point to the same value; the next screen shows the more exact picture.

قوتوویەک یەک بەهارات هەڵدەگرێت و هەرگیز دوو قوتوو یەک بەهارات بەش ناکەن. لە Pythonـدا دوو ناو دەتوانن ئاماژە بە هەمان بکەن؛ شاشەی داهاتوو وێنە وردترەکە پیشان دەدات.

Quick checkپشکنینی خێراWhy is tea_price = 500 better than writing 500 everywhere?بۆچی tea_price = 500 باشترە لە نووسینی ⁦500⁩ لە هەموو شوێنێک؟

04- گۆراو ! Variables & Data Types in PythonMR. Ant · Kurdish (Sorani)کوردی (سۆرانی) · 29K viewsبینین · 971 likesلایک

In Kurdish: what a variable is in Python and the basic data types.

بە کوردی: لە چییە و سەرەکی.

Kurdish video: variables and data types.

ڤیدیۆیەکی کوردی: و .

What is a variable?گۆڕاو چییە؟

Where the value livesنرخەکە لە کوێ دەژی

While a program runs, its values are kept in the computer's (RAM). A variable's name is how your program finds its value again. When the program ends, that memory is given back and the values are gone; to keep data for next time, a program must save it in a file.

کاتێک کار دەکات، لە ⁦(RAM)⁩ هەڵدەگیرێن. ناوی ئەو ڕێگەیەیە کە پێی دەدۆزێتەوە. کاتێک کۆتایی دێت، ئەو بیرگەیە دەدرێتەوە و نامێنن؛ بۆ هەڵگرتنی بۆ جاری داهاتوو، دەبێت لە فایلێکدا پاشەکەوتی بکات.

The box picture is a good start, but Python works a little differently: a variable is a name tag tied to a value. my_age = age does not copy the box; it ties a second tag to the same value. Giving age a new value later moves only the age tag.

وێنەی سندووقەکە سەرەتایەکی باشە، بەڵام Python کەمێک جیاواز کار دەکات: کارتی ناوێکە کە بە بەستراوە. my_age = age سندووقەکە کۆپی ناکات؛ کارتێکی دووەم بە هەمان دەبەستێت. دانانی نوێ بۆ age دواتر تەنها کارتی age دەجووڵێنێت.

Two pictures. Left, the box picture: a box labelled age holds 21. Right, Python's picture: the value 21 sits in memory and two name tags, age and my_age, are tied to it. After age = 22, the age tag moves to a new value 22 and my_age still points to 21.دوو وێنە. لای چەپ، وێنەی سندووق: سندووقێک بە نووسراوی age کە 21ـی تێدایە. لای ڕاست، وێنەی Python: نرخی 21 لە بیرگەدایە و دوو کارتی ناو، age و my_age، پێیەوە بەستراون. دوای age = 22، کارتی age دەچێت بۆ نرخێکی نوێی 22 و my_age هێشتا ئاماژە بە 21 دەکات.
A box is a good first picture; in Python a variable is a name tag on a value.سندووق یەکەم وێنەیەکی باشە؛ لە Pythonـدا کارتی ناوێکە لەسەر .CêIT
name_tags.pyPYTHONType in a terminalلە تێرمیناڵدا بینووسە
age = 21
my_age = age
print(age, my_age)
age = 22
print(age, my_age)
Explain the codeڕوونکردنەوەی کۆدەکە
Lineدێڕی 2

A second name for the same value.

ناوێکی دووەم بۆ هەمان .

Lineدێڕی 4

Only the tag age moves to the new value 22; my_age still shows 21.

تەنها کارتی age دەچێت بۆ نوێی ⁦22⁩؛ my_age هێشتا ⁦21⁩ پیشان دەدات.

Quick checkپشکنینی خێراWhat does this print? a = 3, then b = a, then a = 10, then print(a, b)ئەمە چی چاپ دەکات؟ a = 3، پاشان b = a، پاشان a = 10، پاشان print(a, b)

What is a variable?گۆڕاو چییە؟

Every value is an object with an idهەموو نرخێک ئۆبجێکتێکە و ناسنامەی هەیە

In Python every value — a number, a piece of text, a list — is an : a thing in memory with a type, a value and an identity. The built-in function id() gives that identity as a whole number. It stays the same while the object exists, and no other object has it at the same time. In CPython, the usual Python, it is the object’s memory address.

لە Pythonـدا هەموو (ژمارەیەک، دەقێک، ) : شتێک لە کە جۆرێک، و ناسنامەیەکی هەیە. id() ئەو ناسنامەیە وەک دەداتەوە. تا بوونی هەبێت وەک خۆی دەمێنێتەوە و هیچ تر لە هەمان کاتدا هەمان ژمارەی نییە. لە CPythonـدا، کە Pythonـە ئاساییەکەیە، ئەم ژمارەیە .

PYTHON
age = 21
my_age = age
print(id(age) == id(my_age))   # one object, two name tags
age = age + 1
print(id(age) == id(my_age))   # age now names a new object
print(age, my_age)
x = 5
y = 5
print(id(x) == id(y))          # True in CPython: small ints are shared
Quick checkپشکنینی خێراAfter a = 7 and b = a, what does print(id(a) == id(b)) show?دوای a = 7 و b = a، print(id(a) == id(b)) چی پیشان دەدات؟

Creating a variable: assignmentدروستکردنی گۆڕاو: دانانی نرخ

In Python you create a variable with : the name, an equals sign, and a value. The general form is var_name = value, for example age = 21. There is no separate declaration: the variable comes into existence the first time you assign to it, and Python works out its type from the value.

لە Pythonـدا بە دروست دەکەیت: ناوەکە، نیشانەی یەکسان و . شێوە گشتییەکەی var_name = valueـە، بۆ نموونە age = 21. هیچ ناساندنێکی جیا نییە: یەکەم جار کە بۆ دادەنێیت دروست دەبێت و Python جۆرەکەی لە دەدۆزێتەوە.

age.pyPYTHONType in a terminalلە تێرمیناڵدا بینووسە
age = 21
print(age)
print("age")
Explain the codeڕوونکردنەوەی کۆدەکە
Lineدێڕی 2

Without quotes, age is the variable: Python prints its value.

بەبێ ، age : Python چاپ دەکات.

Lineدێڕی 3

With quotes, "age" is just text: Python prints the word.

بە ، "age" تەنها دەقە: Python وشەکە چاپ دەکات.

Read = as “gets” or “becomes”, not “equals”. Python first works out the value on the right, then ties the name on the left to it. So the name must be on the left; a value on the left is an error. (Comparing two values uses ==, taught in Making decisions.)

= وەک «وەردەگرێت» یان «دەبێت بە» بخوێنەوە، نەک «یەکسانە». Python سەرەتا لای ڕاست دەژمێرێت، پاشان ناوی لای چەپ پێیەوە دەبەستێت. بۆیە ناوەکە دەبێت لە لای چەپ بێت؛ لە لای چەپ هەڵەیە. (بەراوردکردنی دوو == بەکار دەهێنێت، کە لە بڕیاردان فێر دەکرێت.)

backwards.pyPYTHONType in a terminalلە تێرمیناڵدا بینووسە
21 = age

Using a variable before it has been given a value is a runtime error, because the name does not exist yet:

بەکارهێنانی پێش ئەوەی بدرێتێ ، چونکە ناوەکە هێشتا بوونی نییە:

too_early.pyPYTHONType in a terminalلە تێرمیناڵدا بینووسە
print(score)
score = 10
Quick checkپشکنینی خێراWhat does x = 7 do?x = 7 چی دەکات؟

Changing a variableگۆڕینی گۆڕاو

A variable can be given a new value at any time. The old value is then forgotten. Because Python runs from top to bottom, the value you see depends on where in the program you look.

لە هەر کاتێکدا دەتوانێت نوێ وەربگرێت. ئەو کاتە لەبیر دەکرێت. چونکە Python لە سەرەوە بۆ خوارەوە جێبەجێ دەکات، ئەو دەیبینیت بەندە بەوەی لە کوێی سەیر دەکەیت.

Animation: three lines of code are highlighted one after another: score = 0, score = 5, score = 12. Next to them a box labelled score shows 0, then 5, then 12, and each old value fades away. An output panel shows 0, 5 and 12 as each print runs.
Animation: three lines of code are highlighted one after another: score = 0, score = 5, score = 12. Next to them a box labelled score shows 0, then 5, then 12, and each old value fades away. An output panel shows 0, 5 and 12 as each print runs.
Each assignment replaces the value; print shows the value at that moment.هەر دەگۆڕێت؛ print ئەو پیشان دەدات کە لەو ساتەدا هەیە.CêIT
score.pyPYTHONType in a terminalلە تێرمیناڵدا بینووسە
score = 0
print(score)
score = 5
print(score)
score = 12
print(score)

A variable can even get a new value made from its old value. In visitors = visitors + 1, Python first reads the old value (10), adds 1, and then ties visitors to the result (11). In maths x = x + 1 would be impossible; in Python it is one of the most common lines you will write. The short form visitors += 1 is shown in Operators and expressions.

تەنانەت دەتوانێت نوێ وەربگرێت کە لە خۆی دروست کراوە. لە visitors = visitors + 1ـدا، Python سەرەتا ⁦(10)⁩ دەخوێنێتەوە، 1ـی بۆ زیاد دەکات و پاشان visitors بە ئەنجامەکەوە ⁦(11)⁩ دەبەستێت. لە بیرکاریدا x = x + 1 مەحاڵ دەبوو؛ لە Pythonـدا یەکێکە لە باوترین ئەو دێڕانەی دەینووسیت. شێوە کورتەکەی visitors += 1 لە کارپێکەرەکان و دەربڕینەکان پیشان دراوە.

visitors.pyPYTHONType in a terminalلە تێرمیناڵدا بینووسە
visitors = 10
visitors = visitors + 1
print(visitors)
Quick checkپشکنینی خێراWhat is printed? x = 5, y = x + 2, x = 10, y = y + x, print(x, y)چی چاپ دەکرێت؟ x = 5، y = x + 2، x = 10، y = y + x، print(x, y)

Rules for namesیاساکانی ناو

A variable's name is an . Python's rules for it are short:

ناوی . یاساکانی Python بۆی کورتن:

  • Use letters, digits and the underscore _ only: no spaces, no -, no $.
  • Do not start with a digit: mark2 is fine, 2nd_mark is not.
  • Do not use a , a word that already has a meaning in Python, such as if, for, class or True.
  • Capital letters count: Python is , so age, Age and AGE are three different variables.
  • تەنها پیت، ژمارە و _ بەکار بهێنە: نە ، نە -، نە $.
  • بە ژمارە دەست پێ مەکە: mark2 دروستە، 2nd_mark نا.
  • بەکار مەهێنە، واتە وشەیەک کە پێشتر لە Pythonـدا واتای هەیە، وەک if، for، class یان True.
  • پیتی گەورە حیساب دەکرێت: Python ، بۆیە age، Age و AGE سێ جیاوازن.
Allowed and forbidden namesناوی ڕێگەپێدراو و قەدەغەکراو
NameناوOK?دروستە؟What Python 3.12 says⁦Python 3.12⁩ چی دەڵێت
student_nameyesبەڵێ
mark2yesبەڵێ
_counteryesبەڵێ
2nd_placeno: starts with a digitنەخێر: بە ژمارە دەست پێ دەکاتSyntaxError: invalid decimal literal
my-nameno: - means minusنەخێر: - نیشانەی لێدەرکردنەSyntaxError: cannot assign to expression here. Maybe you meant '==' instead of '='?
my nameno: a spaceنەخێر: SyntaxError: invalid syntax
price$no: $ is not allowedنەخێر: $ ڕێگەپێدراو نییەSyntaxError: invalid syntax
classno: a keywordنەخێر: SyntaxError: invalid syntax
Quick checkپشکنینی خێراWhich name is allowed?کام ناو ڕێگەپێدراوە؟

Rules for namesیاساکانی ناو

Keywords and capital lettersوشە کلیلەییەکان و پیتی گەورە

Python has 35 keywords: False, None, True, and, as, assert, async, await, break, class, continue, def, del, elif, else, except, finally, for, from, global, if, import, in, is, lambda, nonlocal, not, or, pass, raise, return, try, while, with, yield. A few more words, such as match, case and type, are keywords only in special places, so avoid them as names too.

⁦Python 35⁩ هەیە: False، None، True، and، as، assert، async، await، break، class، continue، def، del، elif، else، except، finally، for، from، global، if، import، in، is، lambda، nonlocal، not، or، pass، raise، return، try، while، with، yield. چەند وشەیەکی تریش، وەک match، case و type، تەنها لە شوێنی تایبەتدا ، بۆیە وەک ناو خۆتیان لێ بپارێزە.

good_names.pyPYTHONType in a terminalلە تێرمیناڵدا بینووسە
student_name = "Hana"
mark2 = 88
_counter = 0
Age = 19
age = 20
AGE = 21
print(student_name, mark2, _counter)
print(Age, age, AGE)
Explain the codeڕوونکردنەوەی کۆدەکە
Lineدێڕی 4-6

Three different variables, because capital letters count.

سێ جیاواز، چونکە پیتی گەورە حیساب دەکرێت.

Quick checkپشکنینی خێراWhich word can never be a variable name in Python?کام وشە هەرگیز ناتوانێت لە Pythonـدا ببێتە ناوی ؟

Choosing good namesهەڵبژاردنی ناوی باش

The rules say what Python accepts; style says what other programmers expect. Python's style guide, PEP 8, asks for:

یاساکان دەڵێن Python چی قبووڵ دەکات؛ شێواز دەڵێت تر چاوەڕێی چی دەکەن. ڕێبەری شێوازی Python، ⁦PEP 8⁩، داوای ئەمانە دەکات:

Naming stylesشێوازەکانی ناونان
StyleشێوازExampleنموونەUsed forبۆ چی بەکار دێت
total_priceVariables and functions in Python (all lower case, words joined by _) و لە Pythonـدا (هەمووی پیتی بچووک، وشەکان بە _ بەستراون)
ALL CAPITALSهەمووی پیتی گەورەTEA_PRICE: values that should not change. Python does not stop you changing them; the capitals are a promise to the reader.: ئەو نابێت بگۆڕێن. Python ڕێگرت لێ ناکات بیانگۆڕیت؛ پیتە گەورەکان بەڵێنێکن بە خوێنەر.
totalPriceJava and JavaScript. The lecturer's slides use it (cubeVolume); it works in Python, but PEP 8 prefers snake_case.Java و JavaScript. سلایدەکانی مامۆستا بەکاری دەهێنن (cubeVolume)؛ لە Pythonـدا کار دەکات، بەڵام ⁦PEP 8 snake_case⁩ـی پێ باشترە.
constants.pyPYTHONType in a terminalلە تێرمیناڵدا بینووسە
TEA_PRICE = 500
MAX_STUDENTS = 30
print(TEA_PRICE * 3, MAX_STUDENTS)
  • Choose names that say what the value is: average_mark, not am or x1.
  • Short names such as i or x are fine for a counter or a maths formula.
  • Avoid l, O and I alone: in many fonts they look like 1 and 0.
  • ناوێک هەڵبژێرە کە بڵێت چییە: average_mark، نەک am یان x1.
  • ناوی کورتی وەک i یان x بۆ یان هاوکێشەیەکی بیرکاری باشن.
  • خۆت لە l، O و I بە تەنها بپارێزە: لە زۆر فۆنتدا وەک 1 و 0 دەردەکەون.
Quick checkپشکنینی خێراWhich name follows PEP 8 for a variable that holds a student's average mark?کام ناو بەپێی ⁦PEP 8⁩ـە بۆ کە تێکڕای نمرەی قوتابییەک هەڵدەگرێت؟

Data types: what kind of value?جۆرەکانی دراوە: چ جۆرە نرخێک؟

Every value has a , which decides what you can do with it: you can multiply two numbers, but not two words. The basic types of Python are:

هەموو هەیە، کە بڕیار دەدات چی پێ دەکرێت: دەتوانیت دوو ژمارە لێک بدەیت، بەڵام دوو وشە نا. سەرەکییەکانی Python ئەمانەن:

Python's basic data types سەرەکییەکانی Python
TypeجۆرName in Pythonناو لە PythonـداExamplesنموونەUseبەکارهێنان
int21 0 -7 1_000_000Counting, ages, marks without fractionsژماردن، تەمەن، نمرەی بێ کەرت
float1.62 3.0 -0.5Measurements, averages, prices with fractionsپێوانە، تێکڕا، نرخی کەرتدار
str"Shilan" '21' ""Names, messages, any textناو، پەیام، هەر دەقێک
boolTrue FalseYes/no answers, conditionsوەڵامی بەڵێ/نەخێر،
No valueNoneTypeNone“Nothing yet”«هێشتا هیچ»

The type() tells you the type of any value:

type() جۆری هەر پێت دەڵێت:

show_types.pyPYTHONType in a terminalلە تێرمیناڵدا بینووسە
print(type(21))
print(type(21.0))
print(type("21"))
print(type(True))
print(type(None))
Explain the codeڕوونکردنەوەی کۆدەکە
Lineدێڕی 1

<class 'int'> means “this value is an int”. In Python every type is a class.

<class 'int'> واتە «ئەم intـە». لە Pythonـدا هەموو جۆرێک .

One print() can show variables of different types together; commas keep them apart:

یەک print() دەتوانێت لە جۆری جیاواز پێکەوە پیشان بدات؛ کۆماکان لێکیان جیا دەکەنەوە:

student_profile.pyPYTHONType in a terminalلە تێرمیناڵدا بینووسە
name = "Shilan"
age = 19
height = 1.62
is_student = True
print(name, age, height, is_student)
print(type(name), type(age), type(height), type(is_student))
Quick checkپشکنینی خێراWhat is the type of "3.5"?جۆری "3.5" چییە؟

Data types: what kind of value?جۆرەکانی دراوە: چ جۆرە نرخێک؟

Whole numbers and decimal numbersژمارە تەواوەکان و ژمارە کەرتییەکان

An (int) is a whole number: 21, 0, -7. Python's integers have no size limit; they can be as long as your memory allows. You may write _ between digits to make big numbers easier to read: 1_000_000 is one million.

(int) ژمارەیەکی بێ کەرتە: 21، 0، -7. Python سنووری قەبارەیان نییە؛ دەتوانن هێندە درێژ بن کە ڕێگە دەدات. دەتوانیت _ لە نێوان ژمارەکاندا بنووسیت بۆ ئاسانکردنی خوێندنەوەی ژمارە گەورەکان: 1_000_000 یەک ملیۆنە.

A (float) is a number with a decimal point; in code the decimal point is always a dot, never a comma: 1.62, 3.0, -0.5. Dividing with / always gives a float, even 8 / 4 gives 2.0. Floats are stored in binary, so some decimal answers are a tiny bit off; Operators and expressions explains why and what to do.

(float) ژمارەیەکە کە هەیە؛ لە کۆددا هەمیشە خاڵە (.)، هەرگیز کۆما نییە: 1.62، 3.0، -0.5. دابەشکردن بە / هەمیشە دەدات، تەنانەت 8 / 4 دەدات 2.0. بە هەڵدەگیرێن، بۆیە هەندێک وەڵامی دەیی کەمێک لاری هەیە؛ کارپێکەرەکان و دەربڕینەکان ڕوونی دەکاتەوە بۆچی و چی بکەیت.

Python has a third kind of number, complex (complex), written with a j for the imaginary part, such as 3+4j. Engineers and physicists use it; in this course you will rarely need it.

Python جۆری سێیەمی ژمارەشی هەیە، (complex)، کە بەشە خەیاڵییەکەی بە j دەنووسرێت، وەک 3+4j. ئەندازیاران و فیزیکزانان بەکاری دەهێنن؛ لەم کۆرسەدا کەم پێویستت پێی دەبێت.

number_types.pyPYTHONType in a terminalلە تێرمیناڵدا بینووسە
population = 1_000_000
big = 123456789012345678901234567890
print(population)
print(big * 10)
print(7 / 2)
print(0.1 + 0.2)
z = 3+4j
print(z, type(z))
z = 3+4j
print(z, type(z))
z = 3+4j
print(z, type(z))
Explain the codeڕوونکردنەوەی کۆدەکە
Lineدێڕی 6

Not exactly 0.3: a normal float surprise, not a bug in Python.

ڕێک ⁦0.3⁩ نییە: سەرسوڕمانێکی ئاسایی ، نەک لە Pythonـدا.

Quick checkپشکنینی خێراWhat type does 7 / 7 give?7 / 7 چ جۆرێک دەدات؟

Data types: what kind of value?جۆرەکانی دراوە: چ جۆرە نرخێک؟

Text, True and False, and Noneدەق، True و False لەگەڵ None

A (str) is text in quotes. Be careful: "21" is text made of the characters 2 and 1, not the number 21, and "True" is a word, not a truth value.

(str) دەقێکە لەناو . ئاگادار بە: "21" دەقێکە لە 2 و 1 پێک هاتووە، نەک ژمارەی ⁦21⁩ و "True" وشەیەکە، نەک ڕاستی.

A (bool) has only two values, True and False, always with a capital first letter. You get them from questions such as 5 > 3; they drive the decisions in Making decisions.

(bool) تەنها دوو هەیە، True و False، هەمیشە بە یەکەم پیتی گەورە. لە پرسیارەکانی وەک 5 > 3 وەریان دەگریت؛ بڕیارەکانی بڕیاردان دەجووڵێنن.

None means “no value yet” or “nothing”. It is useful as a starting value. Many languages call this idea null ().

None واتە «هێشتا هیچ نییە» یان «هیچ». وەک سەرەتا بەسوودە. زۆر زمان ئەم بیرۆکەیە ناو دەنێن null ().

truth.pyPYTHONType in a terminalلە تێرمیناڵدا بینووسە
is_open = True
print(is_open)
print(5 > 3)
result = None
print(result)
print(type("True"), type(True))
lower_true.pyPYTHONType in a terminalلە تێرمیناڵدا بینووسە
is_open = true
Explain the codeڕوونکردنەوەی کۆدەکە
Lineدێڕی 1

true in small letters is just an unknown name. Python wants True.

true بە پیتی بچووک تەنها ناوێکی نەناسراوە. Python Trueـی دەوێت.

Quick checkپشکنینی خێراWhich value is a bool?کام boolـە؟

Data types: what kind of value?جۆرەکانی دراوە: چ جۆرە نرخێک؟

The family of Python typesبنەماڵەی جۆرەکانی Python

The types you have met belong to a bigger family. The numbers are int, float and complex, and bool is a special kind of int. The sequences keep items in order: str, list and tuple. A set keeps items with no order and no repeats, a dict links keys to values, and None stands alone.

ئەو جۆرانەی ناسیوتن سەر بە بنەماڵەیەکی گەورەترن. ژمارەکان int، float و complexـن و bool جۆرێکی تایبەتی intـە. دانەکان بە ڕیز هەڵدەگرن: str، list و tuple. set دانەکان بێ ڕیز و بێ دووبارە هەڵدەگرێت، dict کلیلەکان بە دەبەستێت و None بە تەنها دەوەستێت.

A family tree. Python values, every value an object, split into five groups. Numbers: int (21), float (1.62) and complex (3+4j), with bool (True) drawn under int because bool is a kind of int and True + True is 2. Sequences, items in order: str ("Hana"), list ([8, 6, 10]) and tuple ((36.19, 44.01)). Sets, no order and no repeats: set ({"tea", "milk"}). Mappings, key to value: dict ({"Hana": 87}). No value: NoneType (None).دارێکی بنەماڵە. نرخەکانی Python، کە هەموو نرخێک ئۆبجێکتێکە، دەبن بە پێنج گرووپ. ژمارەکان: int (21)، float (1.62) و complex (3+4j)، لەگەڵ bool (True) لە ژێر int، چونکە bool جۆرێکە لە int و True + True دەکاتە 2. زنجیرەکان، دانەکان بە ڕیز: str ("Hana")، list ([8, 6, 10]) و tuple ((36.19, 44.01)). کۆمەڵەکان، بێ ڕیز و بێ دووبارە: set ({"tea", "milk"}). جووتەکانی کلیل و نرخ، کلیل بۆ نرخ: dict ({"Hana": 87}). بێ نرخ: NoneType (None).
Python’s built-in types as one family; bool is a kind of int.جۆرە ئامادەکانی Python وەک یەک بنەماڵە؛ bool جۆرێکە لە int.CêIT

True counts as 1 and False as 0. Python allows sums like the one below, but its documentation advises against relying on it: write int(True) when you really want a number. Each type has its own lesson later: strings, lists, and tuples, sets and dictionaries.

True وەک 1 و False وەک 0 دەژمێردرێن. Python ڕێگە بە کۆکردنەوەی وەک ئەوەی خوارەوە دەدات، بەڵام بەڵگەنامەکانی ئامۆژگاری دەکەن پشتی پێ نەبەستیت: کاتێک بەڕاستی ژمارەت دەوێت int(True) بنووسە. هەر جۆرێک دواتر وانەی خۆی هەیە: زنجیرەنووسەکان، لیستەکان و تاپڵەکان، کۆمەڵەکان و فەرهەنگەکان.

PYTHON
print(True + True)
print(True == 1)
print(type(True + True))
print(int(True), int(False))
Quick checkپشکنینی خێراWhere does bool sit in Python’s family of types?bool لە کوێی بنەماڵەی جۆرەکانی Pythonـدایە؟

Dynamic typing: the type belongs to the valueجۆرداریی ناجێگیر: جۆر هی نرخەکەیە

In Python the value has a type, the name does not. A name can point to an int now and to a string later. This is called : types are checked while the program runs, not before.

لە Pythonـدا جۆری هەیە، نەک ناوەکە. ناوێک دەتوانێت ئێستا ئاماژە بە intـێک بکات و دواتر بە . ئەمە پێی دەڵێن : جۆرەکان لە کاتی جێبەجێبوونی دەپشکنرێن، نەک پێشتر.

dynamic.pyPYTHONType in a terminalلە تێرمیناڵدا بینووسە
x = 5
print(x, type(x))
x = "five"
print(x, type(x))
x = 5.0
print(x, type(x))
The name tag x moves between three values in memory: first the int 5, then the str "five", then the float 5.0. Each value carries its own type label; the tag x has no type.کارتی ناوی x لە نێوان سێ نرخ لە بیرگەدا دەجووڵێت: سەرەتا intـی 5، پاشان strـی "five"، پاشان floatـی 5.0. هەر نرخێک نیشانەی جۆری خۆی پێیە؛ کارتی x جۆری نییە.
Dynamic typing: the type is on the value, not on the name.: جۆر لەسەر ، نەک لەسەر ناوەکە.CêIT

Languages with , such as Java and C#, fix a variable's type when you declare it, and the compiler refuses a value of another type before the program runs. Dynamic typing makes Python quick to write; the price is that some type mistakes appear only when that line runs. Reusing one name for different kinds of values also makes code harder to read, so do it rarely. Programming languages compares the two ideas without code.

زمانەکانی خاوەن ، وەک Java و ⁦C#⁩، جۆری لە کاتی ناساندنیدا جێگیر دەکەن و پێش جێبەجێکردنی جۆرێکی تر ڕەت دەکاتەوە. نووسینی Python خێرا دەکات؛ تێچووەکەی ئەوەیە کە هەندێک هەڵەی جۆر تەنها کاتێک دەردەکەون کە ئەو دێڕە جێبەجێ دەبێت. بەکارهێنانی یەک ناو بۆ جۆری جیاوازی خوێندنەوەی کۆد قورستر دەکات، بۆیە کەم ئەمە بکە. وانەی زمانەکانی بەرنامەسازی بەبێ کۆد ئەم دوو بیرۆکەیە بەراورد دەکات.

Quick checkپشکنینی خێراAfter x = 5 and then x = "five", what is type(x)?دوای x = 5 و پاشان x = "five"، type(x) چییە؟

Converting between typesگۆڕینی جۆر

Sometimes you have a value of the wrong type, for example the text "21" when you need the number 21. use the type names as functions: int(), float() and str().

هەندێک جار لە جۆری هەڵەدا هەیە، بۆ نموونە دەقی "21" لە کاتێکدا ژمارەی ⁦21⁩ـت پێویستە. ناوی جۆرەکان وەک بەکار دەهێنێت: int()، float() و str().

convert.pyPYTHONType in a terminalلە تێرمیناڵدا بینووسە
print(int("21") + 1)
print(float("3.5"))
print(str(21) + " years")
print(int(3.9))
print(int(-3.9))
print(float(7))
print(round(3.9))
Explain the codeڕوونکردنەوەی کۆدەکە
Lineدێڕی 1

Text to whole number, then normal arithmetic.

دەق بۆ ، پاشان حیسابی ئاسایی.

Lineدێڕی 3

A number to text; + then joins two strings.

ژمارە بۆ دەق؛ پاشان + دوو پێکەوە دەلکێنێت.

Lineدێڕی 4-5

int() cuts off the fraction (towards zero); it does not round.

int() کەرتەکە دەبڕێت (بەرەو سفر)؛ ناکات.

Lineدێڕی 7

To round to the nearest whole number, use round().

بۆ ژمارەیەک بۆ نزیکترین ، round() بەکار بهێنە.

A conversion fails when the value cannot be read as that type. int("3.5") is a ValueError, because "3.5" is not written as a whole number (use float() first). And Python never mixes text and numbers with + by itself:

شکست دەهێنێت کاتێک ناتوانرێت وەک ئەو جۆرە بخوێندرێتەوە. int("3.5") ValueErrorـە، چونکە "⁦3.5⁩" وەک نەنووسراوە (سەرەتا float() بەکار بهێنە). هەروەها Python هەرگیز خۆبەخۆ دەق و ژمارە بە + تێکەڵ ناکات:

mix.pyPYTHONType in a terminalلە تێرمیناڵدا بینووسە
print("Age: " + 21)
mix_fixed.pyPYTHONType in a terminalلە تێرمیناڵدا بینووسە
age = 21
print("Age: " + str(age))
print("Age:", age)
Explain the codeڕوونکردنەوەی کۆدەکە
Lineدێڕی 2

Convert the number to text first…

سەرەتا ژمارەکە بگۆڕە بۆ دەق…

Lineدێڕی 3

…or simply give print() two arguments.

…یان بە سادەیی دوو بدە بە print().

Quick checkپشکنینی خێراWhat does int("7") + int("8") give?int("7") + int("8") چی دەدات؟

Learn type casting in 7 minutes! 💱Bro Code · Englishئینگلیزی · 312K viewsبینین · 8.9K likesلایک

Changing a value's type with int(), float(), str() and bool(), checking it with type(), and implicit conversion.

بە int()، float()، str() و bool()، پشکنینی جۆری بە type() و .

Whole video (7:37): type() (1:24), explicit casts (2:23), implicit casts (6:17).

هەموو ڤیدیۆکە ⁦(7:37)⁩: type() ⁦(1:24)⁩، ⁦(2:23)⁩ و ⁦(6:17)⁩.

Common mistakesهەڵە باوەکان

MistakeهەڵەWhat happens (Python 3.12)چی ڕوو دەدات ⁦(Python 3.12)⁩Fixچارەسەر
print("age")Prints the word age, not the valueوشەی age چاپ دەکات، نەک No quotes around a variable: print(age). لە دەوری دامەنێ: print(age).
21 = ageSyntaxError: cannot assign to literal here. Maybe you meant '==' instead of '='?The name goes on the left: age = 21.ناوەکە دەچێتە لای چەپ: age = 21.
Using a name before assigning itبەکارهێنانی ناوێک پێش دانانی NameError: name 'score' is not definedAssign first, then use.سەرەتا دابنێ، پاشان بەکاری بهێنە.
Age in one place, age in anotherAge لە شوێنێک، age لە شوێنێکی ترTwo different variables, or a NameErrorدوو جیاواز، یان NameErrorUse exactly the same spelling.ڕێک هەمان نووسین بەکار بهێنە.
is_open = trueNameError: name 'true' is not defined. Did you mean: 'True'?Write True and False with capitals.True و False بە پیتی گەورە بنووسە.
print("Age: " + 21)TypeError: can only concatenate str (not "int") to strstr(21), or use commas in print().str(21)، یان لە print()ـدا کۆما بەکار بهێنە.
int("3.5")ValueError: invalid literal for int() with base 10: '3.5'Use float("3.5"), then int() if you need a whole number.float("3.5") بەکار بهێنە، پاشان int() ئەگەر پێویستە.
print = 5, then print("Hello")print = 5، پاشان print("Hello")TypeError: 'int' object is not callableNever use names of built-in functions (print, input, type, str, list, sum) for your variables.هەرگیز ناوی (print، input، type، str، list، sum) بۆ بەکار مەهێنە.

Practiceڕاهێنان

ExerciseڕاهێنانA student profileپرۆفایلی قوتابی

Create four variables for a student called Hana: her name, her age (20), her average mark (87.5) and whether she has passed (yes). Print all four on one line, and then print their types.

چوار بۆ قوتابییەک بە ناوی هانا دروست بکە: ناوەکەی، تەمەنی ⁦(20)⁩، تێکڕای نمرەکەی ⁦(87.5)⁩ و ئایا دەرچووە (بەڵێ). هەر چواریان لەسەر یەک دێڕ چاپ بکە و پاشان جۆرەکانیان چاپ بکە.

Show answerوەڵامەکە پیشان بدە
hana.pyPYTHONType in a terminalلە تێرمیناڵدا بینووسە
name = "Hana"
age = 20
average_mark = 87.5
has_passed = True
print(name, age, average_mark, has_passed)
print(type(name), type(age), type(average_mark), type(has_passed))
ExerciseڕاهێنانWhich names are valid?کام ناوانە دروستن؟

Which of these can be variable names? total_marks, 2nd, _temp, class, firstName, my-age, Class, price$

کام لەمانە دەتوانن ببنە ناوی ؟ total_marks، 2nd، _temp، class، firstName، my-age، Class، price$

Show answerوەڵامەکە پیشان بدە
  • Valid: total_marks, _temp, firstName (allowed, but PEP 8 prefers first_name), Class (allowed because Python is case-sensitive, but confusing).
  • Not valid: 2nd (starts with a digit), class (keyword), my-age (- is minus), price$ ($ is not allowed).
  • دروستن: total_marks، _temp، firstName (ڕێگەپێدراوە، بەڵام ⁦PEP 8⁩ first_nameـی پێ باشترە)، Class (ڕێگەپێدراوە چونکە Python ، بەڵام سەرلێشێوێنەرە).
  • نادروستن: 2nd (بە ژمارە دەست پێ دەکات)، class ()، my-age (- نیشانەی لێدەرکردنە)، price$ ($ ڕێگەپێدراو نییە).
ExerciseڕاهێنانSwap two cupsگۆڕینەوەی دوو پەرداخ

cup_a holds "tea" and cup_b holds "milk". Swap them so that print(cup_a, cup_b) shows milk tea. Why does cup_a = cup_b followed by cup_b = cup_a not work?

cup_a "tea" هەڵدەگرێت و cup_b "milk". بیانگۆڕەوە بۆ ئەوەی print(cup_a, cup_b) پیشان بدات milk tea. بۆچی cup_a = cup_b و دوای ئەو cup_b = cup_a کار ناکات؟

Hintئاماژە

Think of two full cups and an empty third cup.

دوو پەرداخی پڕ و پەرداخێکی سێیەمی بەتاڵ بهێنە بەرچاو.

Show answerوەڵامەکە پیشان بدە
Wrong: the tea is lostهەڵە: چا ون دەبێتswap_wrong.pyPYTHONType in a terminalلە تێرمیناڵدا بینووسە
cup_a = "tea"
cup_b = "milk"
cup_a = cup_b
cup_b = cup_a
print(cup_a, cup_b)

After cup_a = cup_b both names point to "milk"; the tea is gone. Use a third, empty cup:

دوای cup_a = cup_b هەردوو ناو ئاماژە بە "milk" دەکەن؛ چا نەما. پەرداخێکی سێیەمی بەتاڵ بەکار بهێنە:

swap.pyPYTHONType in a terminalلە تێرمیناڵدا بینووسە
cup_a = "tea"
cup_b = "milk"
temp = cup_a
cup_a = cup_b
cup_b = temp
print(cup_a, cup_b)

Python also has a one-line swap, cup_a, cup_b = cup_b, cup_a, which gives the same output; Tuples, sets and dictionaries explains how it works.

Python گۆڕینەوەیەکی یەک دێڕیشی هەیە، cup_a, cup_b = cup_b, cup_a، کە هەمان دەدات؛ تاپڵەکان، کۆمەڵەکان و فەرهەنگەکان ڕوونی دەکاتەوە چۆن کار دەکات.

ExerciseڕاهێنانPredict the typesجۆرەکان پێشبینی بکە

What does each line print? type(3), type(3.0), type("3"), type(3 > 2), type(int("3")) (each inside print()).

هەر دێڕێک چی چاپ دەکات؟ type(3)، type(3.0)، type("3")، type(3 > 2)، type(int("3")) (هەر یەکەیان لەناو print()ـدا).

Show answerوەڵامەکە پیشان بدە
predict_types.pyPYTHONType in a terminalلە تێرمیناڵدا بینووسە
print(type(3))
print(type(3.0))
print(type("3"))
print(type(3 > 2))
print(type(int("3")))
ExerciseڕاهێنانFix the messageپەیامەکە چاک بکە

This program stops with a TypeError. Fix it in two different ways.

ئەم بەرنامەیە بە TypeError دەوەستێت. بە دوو ڕێگای جیاواز چاکی بکە.

message.pyPYTHONType in a terminalلە تێرمیناڵدا بینووسە
age = 19
print("You are " + age + " years old")
Show answerوەڵامەکە پیشان بدە
message.pyPYTHONType in a terminalلە تێرمیناڵدا بینووسە
age = 19
print("You are " + str(age) + " years old")
print("You are", age, "years old")

Practiceڕاهێنان

More practice: names and typesڕاهێنانی زیاتر: ناو و جۆر

ExerciseڕاهێنانA full name from three partsناوی تەواو لە سێ بەش

Many official forms here ask for three names: your own name, your father’s name and your grandfather’s name. Store the three names in first, father and grandfather, join them with spaces into one variable full_name, and print it.

زۆر فۆرمی فەرمی لێرە داوای سێ ناو دەکەن: ناوی خۆت، ناوی باوکت و ناوی باپیرت. سێ ناوەکە لە first، father و grandfatherـدا هەڵبگرە، بە پێکەوەیان ببەستە بۆ یەک بە ناوی full_name و چاپی بکە.

Hintئاماژە

+ joins strings, but adds no spaces by itself: add " " between the names.

+ پێکەوە دەبەستێت، بەڵام خۆی زیاد ناکات: " " لە نێوان ناوەکاندا دابنێ.

Show answerوەڵامەکە پیشان بدە
PYTHON
first = "Hana"
father = "Karwan"
grandfather = "Soran"
full_name = first + " " + father + " " + grandfather
print(full_name)

print(first, father, grandfather) would show the same line, but only full_name keeps the joined text, ready to be used again later in the program.

print(first, father, grandfather) هەمان دێڕ پیشان دەدات، بەڵام تەنها full_name دەقە بەیەکەوەبەستراوەکە هەڵدەگرێت و ئامادەیە دواتر لە دووبارە بەکار بێتەوە.

ExerciseڕاهێنانChoose the typeجۆرەکە هەڵبژێرە

Which type would you use for each value, and why? (a) the number of months in a year, (b) whether a student lives in the dormitory, (c) a mobile number, (d) pocket money in dinars, (e) the volume of a ball, (f) a student’s name, (g) a home address.

بۆ هەر یەکێک لەم کام جۆر بەکار دەهێنیت و بۆچی؟ (أ) ژمارەی مانگەکانی ساڵ، (ب) ئایا خوێندکارێک لە بەشی ناوخۆیی دەژی، (ج) ژمارەی مۆبایل، (د) پارەی گیرفان بە دینار، (هـ) قەبارەی تۆپێک، (و) ناوی خوێندکارێک، (ز) ناونیشانی ماڵ.

Show answerوەڵامەکە پیشان بدە
ValueTypeجۆرWhyبۆچی
(a) months in a year(أ) مانگەکانی ساڵinta whole number: 12: ⁦12⁩
(b) lives in the dormitory?(ب) لە بەشی ناوخۆیی دەژی؟boolyes or no: True or Falseبەڵێ یان نەخێر: True یان False
(c) mobile number(ج) ژمارەی مۆبایلstrit starts with 0 or +964 and you never do sums with itبە 0 یان ⁦+964⁩ دەست پێ دەکات و هەرگیز حیسابی پێ ناکەیت
(d) pocket money in dinars(د) پارەی گیرفان بە دینارintdinar amounts are whole numbersبڕی دینار
(e) volume of a ball(هـ) قەبارەی تۆپfloatthe result of 43πr3\frac{4}{3}\pi r^3 has decimalsئەنجامی 43πr3\frac{4}{3}\pi r^3 تێدایە
(f) name, (g) address(و) ناو، (ز) ناونیشانstrtextدەق

A phone number stored as an int loses its first 0:

ژمارەی تەلەفۆن ئەگەر وەک int هەڵبگیرێت سفری یەکەمی ون دەبێت:

PYTHON
phone = "07500000000"
print(phone)
print(int(phone))

Summaryپوختە

  • A variable stores a value under a descriptive name so the program can use and change it; in Python it is a name tag on a value in memory.
  • name = value is assignment: the right side is worked out first. No declaration is needed; using a name before it has a value is a NameError.
  • Names: letters, digits and _, not starting with a digit, not a keyword, case-sensitive. Style: snake_case, CONSTANTS in capitals.
  • Basic types: int, float, str, bool, and None; type() shows the type.
  • Every value is an object with a type and an identity (id()). Python’s numbers are int, float and complex; bool is a kind of int.
  • Python uses dynamic typing: the type belongs to the value, and a name can later point to another type.
  • int(), float() and str() convert values; int() cuts off fractions; text and numbers cannot be joined with + without converting.
  • لە ژێر ناوێکی ڕوونکەرەوەدا هەڵدەگرێت بۆ ئەوەی بتوانێت بەکاری بهێنێت و بیگۆڕێت؛ لە Pythonـدا کارتی ناوێکە لەسەر لە .
  • name = value : سەرەتا لای ڕاست دەژمێردرێت. هیچ ناساندنێک پێویست نییە؛ بەکارهێنانی ناوێک پێش ئەوەی هەبێت NameErrorـە.
  • ناو: پیت، ژمارە و _، بە ژمارە دەست پێ ناکات، نییە و . شێواز: ⁦snake_case⁩، بە پیتی گەورە.
  • جۆرە سەرەکییەکان: int، float، str، bool و None؛ type() جۆرەکە پیشان دەدات.
  • هەموو و جۆر و ناسنامەی (id()) هەیە. ژمارەکانی Python بریتین لە int، float و complex؛ bool جۆرێکە لە int.
  • Python بەکار دەهێنێت: جۆر هی و ناوێک دەتوانێت دواتر ئاماژە بە جۆرێکی تر بکات.
  • int()، float() و str() دەگۆڕن؛ int() کەرت دەبڕێت؛ دەق و ژمارە بەبێ گۆڕین بە + پێکەوە نالکێنرێن.
Review questionsپرسیارەکانی پێداچوونەوە
What is the difference between print(age) and print("age")?جیاوازیی نێوان print(age) و print("age") چییە؟

The first prints the variable's value; the second prints the word age.

یەکەمیان چاپ دەکات؛ دووەمیان وشەی age.

Why is x = x + 1 correct in Python?بۆچی x = x + 1 لە Pythonـدا دروستە؟

= is assignment, not equality: Python computes x + 1 with the old value and then ties x to the result.

= ، نەک یەکسانی: Python بە x + 1 دەژمێرێت و پاشان x بە ئەنجامەکەوە دەبەستێت.

What does int(9.99) give, and why?int(9.99) چی دەدات و بۆچی؟

9: int() cuts off the fraction. round(9.99) would give 10.

9: int() کەرتەکە دەبڕێت. round(9.99) ⁦10⁩ دەدات.

What does dynamic typing mean?جۆرداریی ناجێگیر واتای چییە؟

Values have types but names do not; a name can point to an int and later to a string, and types are checked while the program runs.

جۆریان هەیە بەڵام ناوەکان نا؛ ناوێک دەتوانێت ئاماژە بە intـێک بکات و دواتر بە و جۆرەکان لە کاتی جێبەجێکردندا دەپشکنرێن.

Videoڤیدیۆ

Watch a videoسەیری ڤیدیۆیەک بکە

A video that viewers liked a lot and praised in their comments, chosen for this lesson.ڤیدیۆیەک کە بینەران زۆریان پێ خۆش بووە و لە کۆمێنتەکانیاندا ستایشیان کردووە، بۆ ئەم وانەیە هەڵبژێردراوە.

Python variables for beginners ❎Bro Code · Englishئینگلیزی · 369K viewsبینین · 8.7K likesلایک

What a variable is, how to show it with print() and f-strings, and the four basic types: int, float, str and bool.

چییە، چۆن بە print() و پیشانی دەدەیت و چوار سەرەکی: int، float، str و bool.

Whole video (13:30): variables (0:00), f-strings (3:20), the 4 basic data types (4:04), tips (11:26).

هەموو ڤیدیۆکە ⁦(13:30)⁩: ⁦(0:00)⁩، ⁦(3:20)⁩، چوار سەرەکی ⁦(4:04)⁩ و ئامۆژگاری ⁦(11:26)⁩.

Lesson complete!وانەکە تەواو بوو!

Well done. Review the key terms, then go on to the next lesson.دەستخۆش. سەیرێکی زاراوە سەرەکییەکان بکەرەوە، پاشان بڕۆ بۆ وانەی داهاتوو.

Key termsزاراوە سەرەکییەکان

Next lessonوانەی داهاتوو

Operators and Expressionsکارپێکەرەکان و دەربڕینەکان

References and further readingسەرچاوەکان و خوێندنەوەی زیاتر

This lecture is a first edition. The Kurdish text and terminology are waiting for review by Kurdish IT teachers.ئەم وانەیە چاپی یەکەمە. دەقە کوردییەکە و زاراوەکانی چاوەڕێی پێداچوونەوەی مامۆستایانی کوردی بواری IT ن.