0

Someone please explain this code...I came across it in a challenge

print ("*"*5)

17th Mar 2017, 8:13 AM
egbekun karena
egbekun karena - avatar
6 ответов
+ 8
print("*"*5) # print * in five places. It is equivalent to: s = "*" # a string print(s * 5) # It will output ***** Consider this: ex = "a" # a string print(ex * 5) # It will output aaaaa Hope you got it.
17th Mar 2017, 8:34 AM
Wisdom Abioye
Wisdom Abioye - avatar
+ 4
it will print * sign 5 times
17th Mar 2017, 8:18 AM
Jakub Stasiak
Jakub Stasiak - avatar
+ 2
the answer would be : *****
17th Mar 2017, 8:23 AM
SoumyaK4
SoumyaK4 - avatar
+ 2
num=7 num2=1 for i in range(7): print(" " * num + "*" * num2) num=num-1 num2=num2+2 here it is in use. this makes a triangle of *'s
17th Mar 2017, 9:29 AM
LordHill
LordHill - avatar
+ 1
nice one Justin
17th Mar 2017, 10:59 AM
egbekun karena
egbekun karena - avatar
0
yeah I do
17th Mar 2017, 10:51 AM
egbekun karena
egbekun karena - avatar