Post

Sergei Kotov
Sergei Kotov@kotov_dev·
@Python_Dv Answer: A (* ** *** **** *****) For beginners: 1. "*" * i creates i asterisks: "*" * 3 = "***" 2. end=" " replaces the default newline with a space, so all output appears on one line Range(1,6) gives 1,2,3,4,5, creating the pattern!
English
0
0
0
213
Royce
Royce@Royce4Q2·
@Python_Dv for i in range(1, 6): print("*" * i, end=" ") // * ** *** **** ***** A) 6 = end= " " hence 5 sets *
English
0
0
0
89
Arun Kumar Singh
Arun Kumar Singh@arunkinsights·
range(1, 6) → gives values 1, 2, 3, 4, 5 "*" * i → repeats * i times end=" " → prints everything on the same line separated by a space (not newline). So: when i = 1 → * when i = 2 → ** when i = 3 → *** when i = 4 → **** when i = 5 → ***** Output: * ** *** **** ***** That matches Option A
English
0
0
0
81
Manish Khyalia
Manish Khyalia@Manish_Kumar60·
@Python_Dv Option:-(A) Loop run from 1 to 5 because range function include lower limit and exclude upper limit.The end=" " keeps printing on the same line instead of moving to a new line.
English
0
0
0
48
Paylaş