Python Əsas Sintaksisi

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson
Download our mobile app to listen on the go
Get App

Questions and Answers

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?

  • //
  • /*
  • /
  • # (correct)

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?

<p>İnteger, Float, String, Boolean və List (A)</p> Signup and view all the answers

Python-də müqayisə operatorlarından hansıları vardır?

<p>Müqayisə operatorları (C)</p> Signup and view all the answers

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.)

Operators

  • Arithmetic Operators:
    • + (addition)
    • - (subtraction)
    • * (multiplication)
    • / (division)
    • % (modulus)
    • ** (exponentiation)
  • Comparison Operators:
    • == (equal)
    • != (not equal)
    • &gt; (greater than)
    • &lt; (less than)
    • &gt;= (greater than or equal)
    • &lt;= (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.)

Operatorlar

  • Aritmetik Operatorlar:
    • + (əlavə edilmə)
    • - (çixma)
    • * (vurma)
    • / (bölünmə)
    • % (qrəm)
    • ** (üstləmə)
  • Müqayisə Operatorları:
    • == (bərabər)
    • != (bərabər deyil)
    • &gt; (böyük)
    • = (böyük və ya bərabər)
    • &lt; (kiçik)
    • &lt;= (kiçik və ya bərabər)

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

More Like This

Python Programming Basics
5 questions
Python Programming Basics Quiz
3 questions
Python Programming Basics
5 questions

Python Programming Basics

SincereSaxhorn8268 avatar
SincereSaxhorn8268
Python Programming Basics
36 questions
Use Quizgecko on...
Browser
Browser