Posts
 
Reputation
Joined
Last Seen
Strength to Increase Rep
+0
Strength to Decrease Rep
-0
0% Quality Score
Upvotes Received
0
Posts with Upvotes
0
Upvoting Members
0
Downvotes Received
1
Posts with Downvotes
1
Downvoting Members
1
1 Commented Post
~3K People Reached
Favorite Forums
Favorite Tags
Member Avatar for jonjacob_33_0

Write and test a function to meet this specification: squareEach(nums) nums is a LIST of numbers. Modifies the list by squaring each entry. [CODE]def squareEach(nums): for number in nums: number = number ** 2 return number def main(): nums = [3,4] print(squareEach(nums)) main()[/CODE] The output in this case is 9... …

Member Avatar for TrustyTony
0
2K
Member Avatar for jonjacob_33_0

[CODE]def toNumbers(strList): for char in strList: return strList[0:len(char)] def main(): sttr = ['120','125'] print(toNumbers(sttr)) main() [/CODE] The output is: ['120','125'] I want the output to read: 120 125 <-- without the brackets and quotes I'm supposed to take a list of numbers (as strings) and simply return the same numbers …

Member Avatar for JoshuaBurleson
0
818