How to read user input as string in Python

1 Answer

0 votes
s = input("Enter a name: ")

print(s)
print(type(s).__name__)






'''
run:

Enter a name: Odin
Odin
str

'''

 



answered Apr 10, 2021 by avibootz

Related questions

2 answers 198 views
1 answer 155 views
155 views asked Sep 25, 2019 by avibootz
1 answer 203 views
203 views asked Sep 11, 2018 by avibootz
1 answer 154 views
154 views asked Apr 15, 2023 by avibootz
1 answer 137 views
...