0
The square of a number
How to write the code of it in python? The number n is written k times. The resulting number is multiplied by itself. What is the result? Input The first number contains nonnegative integer n (n ≤ 777). The second line contains positive integer k (k ≤ 777). Output Print the resulting number. Input example #1 1 2 Output example #1 121 Input example #2 12 3 Output example #2 14692348944
6 odpowiedzi
+ 8
a=int(input("Enter number:"))
b=int(input("Enter repeats:"))
print((int(str(a)*b)**2))
+ 14
Homework? If you need help for making it just google how to do it.
+ 10
@Pegasus Don't give the answer. Just give the hints.
+ 3
@110000, I didn't find the answer there
+ 2
There are two ways to do this. I am sure you would find it hard to follow up with the string method. I will post an easy trick soon.