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 189 views
1 answer 148 views
148 views asked Sep 25, 2019 by avibootz
1 answer 194 views
194 views asked Sep 11, 2018 by avibootz
1 answer 144 views
144 views asked Apr 15, 2023 by avibootz
1 answer 134 views
...