+ 1

What hapend When i try to multiply by zero in python?

("python" *0) i got no output,, who can explain me why?

24th Nov 2018, 9:18 PM
no name
no name - avatar
5 Respostas
+ 3
when something is zero it means it's null so anything multiply by zero is null it's like deleting it
25th Nov 2018, 11:40 PM
Victor Kariuki
Victor Kariuki - avatar
+ 14
str * int returns int times str "a" * 3 = "aaa" "ab" * 4 = "abababab" so 0 * "python" is ""
24th Nov 2018, 10:15 PM
Mert Yazıcı
Mert Yazıcı - avatar
+ 4
Because multiplication by zero makes everything........nothing🤣
25th Nov 2018, 11:29 AM
Sarvesh Yadav
Sarvesh Yadav - avatar
+ 1
You're basically telling it to print 'python' 0 times, and so nothing is printed.
26th Nov 2018, 5:34 PM
Eragon1980
Eragon1980 - avatar
- 10
Idk I never used python
24th Nov 2018, 10:56 PM
Neko lolipop
Neko lolipop - avatar