Hello, I'm new to python and I wanted to ask you how to make a variable that only admits whole numbers in response to what I mean:
int numero; printf("Ingrese un numero: "); fflush(stdin); scanf("%i",&numero); printf("El numero ingresado es: %i", numero);
It is known that if you enter a string of characters or right away a decimal number within that variable that only allows whole numbers in C, there would be an error in the compilation, to what I am going, how do I achieve that in python? ? since in python from what I saw, no specific variables are declared.
If someone can write me that same code in python language I would be grateful and if possible the same example but with float and char. Thanks.