Can someone pls tell me what's wrong with this code | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Can someone pls tell me what's wrong with this code

def amb_list() amb = "" for i in "drux": amb += i yield amb print(list(amb_list()) #output: ['d', 'dr', 'dru', 'drux']

10th Nov 2022, 7:47 PM
DruxAMB
DruxAMB - avatar
1 Answer
+ 4
# I made annotations where I changed something: def amb_list(): # missing ":" # check the indentation!!! amb = "" for i in "drux": amb += i yield amb print(list(amb_list())) # missing ")"
10th Nov 2022, 7:52 PM
Lisa
Lisa - avatar