Which comparison operator is used to check if two values are not equal?
!=
==
<
What is the correct way to print 'Hello, World!' in Python?
print('Hello, World!')
console.log('Hello, World!')
System.out.println('Hello, World!')
echo 'Hello, World!'
What is the correct way to create a string literal containing both single and double quotes in Python?
Both option 1 and 2 are correct
'He said, "Hello!"'
"He said, 'Hello!'"
Which arithmetic operator is used to calculate the remainder of a division?
%
**
//
/
Which method is used to add a new key-value pair to a dictionary?
insert()
update()
append()
add()
What is the correct way to add a new key-value pair to an existing dictionary in Python?
my_dict['city'] = 'New York'
my_dict + {'city': 'New York'}
my_dict.insert('city', 'New York')
my_dict.append('city', 'New York')
What will this code print?
for i in range(3): for j in range(2): print('*', end='') print()
** ** **
What is the correct way to write and run a Python script named 'my_script.py' from the command line?
run my_script.py
python my_script.py
python run my_script.py
execute my_script.py
How many times will the following loop iterate?
for i in range(3, 8): print(i)
8
3
5
7
What is the correct way to get user input and store it in a variable named 'name'?
input('Enter your name:') = name
name = print('Enter your name:')
print('Enter your name:') = name
name = input('Enter your name:')