Professional Documents
Culture Documents
### AI Basics
15. Which of the following is correct syntax to output "Hello World" in Python?
- A) echo "Hello World"
- B) print("Hello World")
- C) console.log("Hello World")
- D) println("Hello World")
- Answer: B
16. How do you create a variable `x` to store the integer 5 in Python?
- A) int x = 5
- B) x = 5
- C) var x = 5
- D) int x == 5
- Answer: B
17. Which operator is used to check if two values are equal in Python?
- A) =
- B) ==
- C) ===
- D) !=
- Answer: B
20. How do you access the value of the first element of a list named `myList`?
- A) myList[0]
- B) myList[1]
- C) myList.first()
- D) myList(0)
- Answer: A
25. How do you concatenate two strings, `a` and `b`, in Python?
- A) a + b
- B) concat(a, b)
- C) a & b
- D) a.append(b)
- Answer: A