-3
(I am inciante)
I have the following dictionary:
'''
d = {'nome': ' ', 'Idade': 0, 'carteira de trabalho': 0,
'ano de contrato': 0, 'salário': 0.0}
'''
This is the initial version of it, and I have to enter new values as the user type them. I thought I’d use a loop for to do this.
'''
for k in d.keys():
d[k] = input(f'{k}: ')
'''
The problem is: Some values in the dictionary are strings, while others are ints. I thought about solving the problem using an if, but for that I will need to know what is the primitive type of the value k.
Does this Answer your Question? How to use if with variable types in python? ("that would answer your question? How to use if with variable types in python?")
– JeanExtreme002