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 322 views
1 answer 249 views
249 views asked Sep 25, 2019 by avibootz
1 answer 301 views
301 views asked Sep 11, 2018 by avibootz
1 answer 252 views
252 views asked Apr 15, 2023 by avibootz
1 answer 238 views
...