πŸ“Š Python
Q. How can you convert a string `'123'` to an integer in Python?
Code:
s = '123'
  • (A) int(s)
  • (B) str(s)
  • (C) float(s)
  • (D) bool(s)
πŸ’¬ Discuss
βœ… Correct Answer: (A) int(s)

Explanation: `int()` converts a numeric string to an integer.

Explanation by: Mr. Dubey
`int()` converts a numeric string to an integer.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
59
Total Visits
πŸ“½οΈ
8 mo ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
95%
Success Rate