0
Can someone explain the second line of this code of python ??
num = int(input("Enter the number)) for i in range(10, 0, - 1): print(f"{num}*{i}={num*i}")
4 Answers
+ 4
Avinash Tiwari
range(10, 0, - 1)
This will give list in reverse order means
9
8
7
{num} * {i} this will give string format of multiplication of num * i so it will be like
5 * 10
5 * 9
{num * i} this will give multiplied value like
50
45
40
..
last line is like:
print (str(num) + "*" + str(i) + "=" + str(num * i))
+ 3
Avinash Tiwari
Are you learning python from outside because I don't see any python code. You have written in C, C++, php, web but not in python.
+ 2
BTW, indentation of line 3 is wrong. This will give a syntax error.