You have the following:
1. This is not typecasting, it is conversion. The
function takes a string of digits and converts it to an integer value.
is a function that takes a numeric value and converts it into a string of digits.
However in case 2 it is not necessary as the print function will automatically convert numerics to strings in order to display them correctly. Although you would need to modify the print statement to:
print(num, " X ", i, "=", i * num)