0
Question within the app
What is the output of the following Print (3* ‘7’) • I did put 21 but am I missing surrounding parentheses? What may be the issue
3 ответов
+ 3
777
when you multiply by String it repeats the amount of times by the number which you have multiplied
0
Jaycee Paypompee
There would be a error as Print is a invalid syntax.🙄
Well but if I take Print as print (suppose), then it will print 777.
As said by L.M.Paredes, when you multiply a string with a integer the string gets repeated.
Hope you will try this yourself next time.
For to get 21, you should multiply the ints (integers or they can be float), like this:
print(3.0*7.0)
(Gives result as a float: 21.0)
OR
print(3*7)
(Gives result as a int: 21)
0
I understand now very helpful explaination , thanks