What is a variable in Python?, A reserved word, A constant value, A named storage location for data, A mathematical operation, Which of the following is a valid Python variable name?, my_variable, 123variable, $variable, variable-1, What is the result of the expression `5 / 2` in Python?, 2.25, 2.0, 2, 2.5, What is the result of the expression `5 % 2` in Python?, 1, 2, 5, 2.5, What is the purpose of the `input()` function in Python?, Convert data, Display output, Declare variables, Take user input, Which data type is used to store a sequence of characters in Python?, String, Integer, Boolean, Float, What is the primary purpose of the `if` statement in Python?, Define a function, Conditional execution, Create a loop, Print text, What is the result of the expression `5 > 3`?, Error, False, 8, True, Which code snippet will print "Even" if `x` contains an even number?, if x == even: print("Even"), if x % 2 == 0: print("Even"), if x % 2: print("Even"), if x is even: print("Even"), What is the primary purpose of the `for` loop in Python?, Print text, Create a condition, Define a function, Iterate items, In Python, what does the `range()` function return?, Float, String, Sequence of integers, Random number, What is the result of the following code? for i in range(3): print(i), 3, 0, 1, 2, What will be the output of the following code? fruits = ["apple", "banana", "cherry"] for fruit in fruits: print(fruit), "apple" "banana" "cherry", apple banana cherry, apple, banana, cherry, ['apple', 'banana', 'cherry'], What will be the output of the following code? for i in range(5): if i == 2: continue print(i), 0 1 2 3, 0 1 2 3 4, 0 1 3 4, 0 3 4, Python is a high-level programming language., False, True, The `print()` function is used to display output in Python., True, False, The `input()` function is used to get user input in Python., False, True, Python is an object-oriented programming language., False, True, The `len()` function is used to get the length of a string or a list in Python., True, False, The `if` statement is used for conditional execution in Python., False, True, The `range()` function generates a sequence of numbers in Python., False, True

Python Basics Assessment

Vizuelni stil

Prikaži sve

Podešavanja aktivnosti

Tabela

AI Enhanced: Ova aktivnost sadrži sadržaj koji generiše AI. Uči više.

Promeni šablon

Vrati automatski sačuvano: ?