CodeNewbie Community

charles madhuku
charles madhuku

Posted on

python loops

Using exactly three loops print 10 A's, followed by 5 copies of BCD, followed by one E, followed by 15 F's on the same line using python

Discussion (2)

Collapse
randy27 profile image
Randy Gomez
res = ''
for i in range(1, 11):
    res += 'A'

for i  in range(1, 7):
    if i == 6:
        res += 'E'
    else:
       res += 'BCD'

for i in range(1, 16):
    res += 'F'

print(res)
Enter fullscreen mode Exit fullscreen mode
Collapse
dastiles profile image
charles madhuku Author

Thank u