Python Practice › Tuple Programs › Program 42

String to a tuple of characters

EasyTuple Programs · 42 of 70

Write a Python program to convert a string into a tuple of characters.

Advertisement
Input
"Sqatools"
Output
('S', 'q', 'a', 't', 'o', 'o', 'l', 's')

Approach

  1. tuple(text).

Solution

Python
print(tuple("Sqatools"))
Output
('S', 'q', 'a', 't', 'o', 'o', 'l', 's')
Advertisement

Learn the concept

New to this topic? Read the lesson, then come back.

More tuple programs

← All 70 Tuple Programs