I Year Python

What is the output of the following code?\n\nx = 5\nif x > 10:\n print('Hello')\nelse:\n print('World')
World
Hello
Error
None
What is the goal of artificial intelligence?
To simulate human intelligence
To replace human intelligence
To create robots
To solve complex problems
Which of the following are examples of applications of artificial intelligence?
Virtual personal assistants
Self-driving cars
Social media
Microwaves
Washing machines
Which of the following is a valid Python syntax for a while loop?
While x < 5:
While (x < 5)
While x < 5
While x < 5;
While (x < 5):
What is the correct way to define a function in Python?
Def my_function():
Function my_function():
My_function():
Define my_function():
What is the difference between narrow AI and general AI?
What are some ethical considerations in the development and use of artificial intelligence?
Privacy concerns
Bias and discrimination
Job displacement
Lack of transparency
Robot uprising
Which of the following is an example of a mutable data type in Python?
List
Tuple
Dictionary
String
What is the output of the following code?\n\nmy_tuple = (1, 2, 3)\nprint(my_tuple[1])
2
1
3
Error
What is machine learning?
A subset of AI that enables machines to learn from data and improve performance without explicit programming
The process of teaching machines to think like humans
The study of algorithms that can operate autonomously
The development of intelligent computer sy
What is the correct way to access the value associated with a specific key in a dictionary?
Dictionary_name[key]
Key[dictionary_name]
Dictionary_name.value(key)
Dictionary_name.key(value)
Which of the following is the correct way to add an element to the end of a list in Python?
List_name.append(element)
List_name.insert(0, element)
List_name.extend(element)
List_name.add(element)
What is the output of the following code?\n\nmy_list = [1, 2, 3]\nprint(my_list[1:])
[2, 3]
[1, 2, 3]
[1]
Error
What is the correct way to define an empty tuple in Python?
My_tuple = ()
My_tuple = []
My_tuple = {}
My_tuple = None
What is the output of the following code?\n\nmy_dict = {'name': 'John', 'age': 25}\nprint(my_dict.get('gender', 'Unknown'))
'Unknown'
'gender'
'name'
'John'
Which of the following is the correct way to remove an element from a list in Python?
List_name.remove(element)
List_name.delete(element)
Del list_name[element]
List_name.pop(element)
What is the output of the following code?\n\nmy_tuple = (1, 2, 3)\nmy_tuple[1] = 4\nprint(my_tuple)
Error
(1, 4, 3)
(1, 2, 4)
(1, 2, 3, 4)
What is the correct way to access the length of a list in Python?
Len(list_name)
List_name.length()
List_name.size()
Length(list_name)
Which of the following is the correct way to define a dictionary in Python?
My_dict = {}
My_dict = {'key': 'value'}
My_dict = {'key', 'value'}
My_dict = {'key': ['value']}
What is the output of the following code?\n\nmy_dict = {'name': 'John', 'age': 25}\nprint(my_dict.keys())
['name', 'age']
{'name', 'age'}
('name', 'age')
Error
{"name":"I Year Python", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"What is the goal of artificial intelligence?, Which of the following are examples of applications of artificial intelligence?, What is the difference between narrow AI and general AI?","img":"https://www.quiz-maker.com/3012/images/ogquiz.png"}
Make your own Survey
- it's free to start.