how to take only real number in python code example
Example 1: how to check whole number in python
x = 1/3 # insert your number here
print(x - int(x) == 0) # True if x is a whole number, False if it has decimals.
Example 2: how to add a number after each number in an array with a for loop in C++
#include<iostream>
using namespace std;
int main()
{
int a[4];
int i;
for ( i = 0; i < 4; i++ )
a[i] = 0;
for ( i = 0; i < 4; i++ )
cout << a[i] << '\n';
return 0;
}