Guess the output: | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Guess the output:

a = "10" print(a*0)

6th Sep 2022, 12:36 PM
follow ->
follow -> - avatar
5 Answers
+ 2
This is a good example of why it's important to keep in mind how multiplying across types works, so you don't get any unexpected outcomes.
6th Sep 2022, 1:09 PM
Tyler McKechnie
+ 3
Nothing
6th Sep 2022, 12:44 PM
AjaraGuju
AjaraGuju - avatar
+ 3
the code is working, and the output is an empty string.
6th Sep 2022, 2:42 PM
Lothar
Lothar - avatar
+ 2
Why? You can check it in playground...! edit: fancy real answer? :prints "10" zero times
6th Sep 2022, 12:40 PM
Jayakrishna 🇮🇳
+ 2
Consider yourself lucky Python was in a good mood today. You try to fool it into replicating a string zero times Python - "might as well not to replicate at all, what a fool you took me for hooman?"
6th Sep 2022, 1:23 PM
Ipang