Given a list of numbers. write a program python to turn every item of a list into its square.
All Answers
total answers (1)
Severity: 8192
Message: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated
Filename: libraries/Filtered_db.php
Line Number: 23
total answers (1)
Hint:
Iterate numbers from a list one by one using a for loop and calculate the square of the current number
Solution1:Using loop and list method
append()
method.Solution2:Use list comprehension
need an explanation for this answer? contact us directly to get an explanation for this answer