How to typecast a variable with the type stored in another variable?

时间:2018-12-03 13:11:24

标签: python-3.x

a = 4
b = float(a)
c = 'float'

Now, the doubt comes when the target type is stored in another variable.

b = c(a)

This would raise error.

0 个答案:

没有答案