How is a letter being marked in python? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How is a letter being marked in python?

Like, an integer is marked as a "int", etc.

29th Dec 2021, 7:57 AM
Olena
3 Answers
+ 1
You can convert a number to string using str()
29th Dec 2021, 8:28 AM
Lisa
Lisa - avatar
+ 1
Python can tell you the type of data. print(type(1)) print(type('a')) print(type("a")) print(type("abc")) Output: <class 'int'> <class 'str'> <class 'str'> <class 'str'> I think the answer to your question is that a letter is "marked" as a 'str'.
29th Dec 2021, 10:14 AM
Brian
Brian - avatar
+ 1
Solomoni Railoa thanks 😊 I needed a character
30th Dec 2021, 6:42 AM
Olena