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 318 views
1 answer 247 views
247 views asked Sep 25, 2019 by avibootz
1 answer 299 views
299 views asked Sep 11, 2018 by avibootz
1 answer 250 views
250 views asked Apr 15, 2023 by avibootz
1 answer 236 views
...