Question: Multiple Choice Question: += on str vs list.extend Consider this code: def repeat_string(x): x += x def repeat_list(x): x.extend(x) position = [first, second, third, fourth]
Multiple Choice Question: += on str vs list.extend Consider this code: def repeat_string(x): x += x def repeat_list(x): x.extend(x) position = ["first", "second", "third", "fourth"] double position = position repeat_list(double_position) count = "123456789" double_count = count repeat_string(double_count) print (position) print (double position) print(count) print (double_count)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
