-3
\$\begingroup\$
for i in range(1,int(input())+1): 
    print(((10**i -1)//9)*((10**i -1)//9))
print('lol just need to fill one more line to post the question IGNORE IT')

What is the meaning of '*' in between ((10**i -1)//9) and ((10**i -1)//9) in the above print statement?

\$\endgroup\$
0

2 Answers 2

1
\$\begingroup\$

Let's first look at what you are printing:

((10**i -1)//9)*((10**i -1)//9) 

#that is the math task, from which you are printing the result

You asked what * means. This is the multiplication operator...

Let's look at the other things, so you get a better understanding of what is going on

result = 10**i - 1

Here you are doing 10 to the power of i and then minus one. The ** operator means to the power of...

So 2**4 means 2^4 or two to the power of four.

Then you are dividing the result of that task with 9 (result)//9 You are using // which is the floor division. This will cut of the decimal place.

The right side after the * is just the same as the first one. You multiply them with the * operator.

result = (10**i -1)//9
print( result * result ) #Multiplication

I hope that this helped you.

\$\endgroup\$
0
4
\$\begingroup\$

** this means power , for example : 5 ** 2 which mean : 5 squared --> 25.
2 ** 7 which mean : 2 to the power of 7 -- > 128.

// this means Floor division - division that results into whole number adjusted to the left in the number line.
For example:

x = 15
y = 4
print('x / y =',x/y)   # Output: x / y = 3.75
print('x // y =',x//y) # Output: x // y = 3
print('x ** y =',x**y) # Output: x ** y = 50625
print('x * y =',x*y)   # Output: x * y = 60

Update
To be more clear : * this means multiplication operator.

Hope that helps you , Good Luck

\$\endgroup\$
0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.