0
Someone please explain this code...I came across it in a challenge
print ("*"*5)
6 Réponses
+ 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.
+ 4
it will print * sign 5 times
+ 2
the answer would be : *****
+ 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
+ 1
nice one Justin
0
yeah I do