Podcast
Questions and Answers
Which of the following is the correct way to create a variable in Python?
Which of the following is the correct way to create a variable in Python?
- 5 = var
- variable = 5 (correct)
- int var = 5
- var = 5
What is the result of the following code snippet in Python?
x = 5
y = 2
z = x + y
print(z)
What is the result of the following code snippet in Python?
x = 5 y = 2 z = x + y print(z)
- 7 (correct)
- 5
- 2
- 52
Which of the following is the correct way to concatenate two strings in Python?
Which of the following is the correct way to concatenate two strings in Python?
- string1 - string2
- string1 * string2
- string1 / string2
- string1 + string2 (correct)