M
M
Maryna2018-10-21 13:21:09
Python
Maryna, 2018-10-21 13:21:09

What type of variable can be initialized using the input( ) input function?

What type of variable can be given an initial value using the input( ) function in Python?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry, 2018-10-21
@marichkaz

Yes, pretty much whatever you want...

>>> s = input('...')
...string
>>> type(s)
<class 'str'>
>>> d = int(input('...'))
...42
>>> type(d)
<class 'int'>
>>> set_ = set(input('...'))
...123
>>> type(set_)
<class 'set'>
To the extent of fantasy

S
Sergey Gornostaev, 2018-10-21
@sergey-gornostaev

Variables in Python do not have types.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question