Creation of variables

1

How do I create a variable and add the type as an integer but with no value set? I need this variable to do this:

a = int(input())
b = int(input())
x = int # tentei colocar o tipo da variável como inteira dessa forma, mas dá erro.
if a * x == b: # a variável x precisa ser um número qualquer e inteiro para que funcione com o "if".
    print(f'O MMC entre {a} e {b} é {a}.')
    
asked by anonymous 17.12.2017 / 15:47

1 answer

1

It gives an error because Python is a dynamically typed language, there are no types, all variables can be anything.

In fact the code does not even make sense because x has no value and should not be used at all.

Put a value in the variable and you're done.

I doubt that it will make logic right, but it will compile and run without errors, there you see what you want to do with logic.

    
17.12.2017 / 15:58