11/20/2016 10:00:48 AM
Sree Latha5 Answers
New AnswerIf the strings represent numbers, you can convert them to numbers, multiply the numbers and if needed, convert the result back to string
Alain, you're wrong. Your example doesn't work, because you multiply None that print returns by 10 and it gives an error : >>> print ("@") * 10 @ Traceback (most recent call last): File "<pyshell#4>", line 1, in <module> print ("@") * 10 TypeError: unsupported operand type(s) for *: 'NoneType' and 'int' Here is the correct example: print('coding...'*5) coding...coding...coding...coding...coding...
For Sree Latha. In this case, "spam" and "eggs" are considered variables. print(spam*eggs)=4*5=20
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message