Core Python Syntax

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/12

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 5:49 PM on 6/17/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

13 Terms

1
New cards

x = 5

Assigns the value 5 to variable x

2
New cards

x, y = 1, 2

Assigns 1 to x and 2 to y using tuple unpacking

3
New cards

a, b = b, a

Swaps the values of a and b

4
New cards

if condition:

Starts a conditional block

5
New cards

elif condition:

Adds another conditional branch

6
New cards

else:

Runs when no previous condition was true

7
New cards

for i in range(n):

Iterates i from 0 to n - 1

8
New cards

while condition:

Repeats while condition is true

9
New cards

break

Immediately exits the nearest loop

10
New cards

continue

Skips the rest of the current loop iteration

11
New cards

def f(x):

Defines a function with parameter x

12
New cards

return value

Exits a function and sends back value

13
New cards

lambda x: x + 1

Creates an anonymous function