Podcast
Questions and Answers
Python-də blok düzəlişini müəyyən etmək üçün hansı sintaksis elementindən istifadə olunur?
Python-də blok düzəlişini müəyyən etmək üçün hansı sintaksis elementindən istifadə olunur?
- Kommentlər
- Dəyişənlər
- İndentasiya (correct)
- Operatorlar
Python-də kommentlərin başlamasına səbəb olan simvol hansıdır?
Python-də kommentlərin başlamasına səbəb olan simvol hansıdır?
- //
- /*
- /
- # (correct)
Python-də dəyişənə məlumat tövsiyə edərkən hansı operator istifadə olunur?
Python-də dəyişənə məlumat tövsiyə edərkən hansı operator istifadə olunur?
- = (correct)
- ==
- +=
- :=
Python-də ədədlərin növlərindən hansılar vardır?
Python-də ədədlərin növlərindən hansılar vardır?
Python-də müqayisə operatorlarından hansıları vardır?
Python-də müqayisə operatorlarından hansıları vardır?
Flashcards are hidden until you start studying
Study Notes
Basic Syntax
- Indentation: Python uses indentation (spaces or tabs) to define block-level structure.
- Comments: Comments start with
#
and extend to the end of the line.
Variables and Data Types
- Variables: Assigned using the assignment operator (
=
). - Data Types:
- Integers:
int
(e.g.,1
,2
, etc.) - Floats:
float
(e.g.,3.14
,-0.5
, etc.) - Strings:
str
(e.g.,'hello'
,"hello"
, etc.) - Boolean:
bool
(e.g.,True
,False
) - List:
list
(e.g.,[1, 2, 3]
,['a', 'b', 'c']
, etc.)
- Integers:
Operators
- Arithmetic Operators:
+
(addition)-
(subtraction)*
(multiplication)/
(division)%
(modulus)**
(exponentiation)
- Comparison Operators:
==
(equal)!=
(not equal)>
(greater than)<
(less than)>=
(greater than or equal)<=
(less than or equal)
- Logical Operators:
and
(logical and)or
(logical or)not
(logical not)
Control Structures
- If-Else Statements:
if condition:
# code to execute if condition is true
else:
# code to execute if condition is false
- For Loops:
for variable in iterable:
# code to execute for each item in iterable
- While Loops:
while condition:
# code to execute while condition is true
Functions
- Defining a Function:
def function_name(parameters):
# code to execute when function is called
- Calling a Function:
function_name(arguments)
Əsas Sintaks
- İndentasiya: Python boşluqlar (fəzalar və ya sekme) blok səviyyəsində strukturunu təyin etmək üçün istifadə edir.
- Şərhlər: Şərhlər
#
simvolu ilə başlayır və sətrin sonuna qədər uzulur.
Dəyişən və Məlumat Növləri
- Dəyişən: Təyinat operatoru (
=
) istifadə edilərək ayrılandırılır. - Məlumat Növləri:
- Ədədlər:
int
(məsələn,1
,2
, və s.) - Ümumi Ədədlər:
float
(məsələn,3.14
,-0.5
, və s.) - Strlar:
str
(məsələn,'hello'
,"hello"
, və s.) - Bool:
bool
(məsələn,True
,False
) - Siyahı:
list
(məsələn,[1, 2, 3]
,['a', 'b', 'c']
, və s.)
- Ədədlər:
Operatorlar
- Aritmetik Operatorlar:
+
(əlavə edilmə)-
(çixma)*
(vurma)/
(bölünmə)%
(qrəm)**
(üstləmə)
- Müqayisə Operatorları:
==
(bərabər)!=
(bərabər deyil)>
(böyük)=
(böyük və ya bərabər)<
(kiçik)<=
(kiçik və ya bərabər)
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.