15,918,471 members
See more:
Python
```num = int(input("Enter the number"))
for i in range(1, 11):
#print(str(num) + " X " + str(i) + "=" + str(i*num))```

'''I understand the typecasting that on how we take user from input in form of int and we are converting in in str again but my doubt here is that how is it, we are performing the int type operation on str type things .One request please keep it in simple logic . I am just a beginner in coding and the above question is from a solution of a question tutorial I was watching online . if you have more than online logic please share that .. The question was to print a multiplication table in python using loop Thanks in advance '''

What I have tried:

I am not getting the logic on performing int type operation in python on str data type
Posted
Updated 24-Dec-22 3:55am
v6

## Solution 1

You have the following:
1. This is not typecasting, it is conversion. The `int` function takes a string of digits and converts it to an integer value.
2. Again, `str` 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:
Python
`print(num, " X ", i, "=", i * num)`