Python - Problem Solving | Find Perfect Squares | List Concatenation | Alternate List Concatenation

Опубликовано: 27 Март 2026
на канале: Love To Code
96
1

This video contains 3 sets of problems:

1. Write a function on all that applies a function to every element of a list. Use it to print the first twenty perfect squares. The perfect squares can be found by multiplying each natural number with itself. The first few perfect squares are 1*1= 1, 2*2=4, 3*3=9, 4*4=16. Twelve for example is not a perfect square because there is no natural number m so that m*m=12. (This question is tricky if your programming language makes it difficult to pass functions as arguments.)

2. Write a function that concatenates two lists. [a,b,c], [1,2,3] → [a,b,c,1,2,3]

3. Write a function that combines two lists by alternatingly taking elements, e.g. [a,b,c], [1,2,3] → [a,1,b,2,c,3]."