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 211 views
1 answer 167 views
167 views asked Sep 25, 2019 by avibootz
1 answer 209 views
209 views asked Sep 11, 2018 by avibootz
1 answer 162 views
162 views asked Apr 15, 2023 by avibootz
1 answer 146 views
...