πŸ“Š Python
Q. What is the output of the following code?
Code:
x = 'Python'
print(x[0])
  • (A) P
  • (B) y
  • (C) n
  • (D) Error
πŸ’¬ Discuss
βœ… Correct Answer: (A) P

Explanation: Strings in Python are indexed starting at 0, so x[0] gives 'P'.

Explanation by: Ankit Singh
Strings in Python are indexed starting at 0, so x[0] gives 'P'.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
50
Total Visits
πŸ“½οΈ
7 mo ago
Published
πŸŽ–οΈ
Ankit Singh
Publisher
πŸ“ˆ
93%
Success Rate