Answered step by step
Verified Expert Solution
Question
1 Approved Answer
blockpy 32.1-32.6 (for loops) in PYTHON #32.5) For with Function Saved BlockPy: #32.1) Hello Names The for loop below is meant to print out each
blockpy 32.1-32.6 (for loops) in PYTHON
#32.5) For with Function Saved BlockPy: #32.1) Hello Names The for loop below is meant to print out each value of the list with a mesage However, the lines of code are out of order. Correct the order of the lines and fix any indentation. Server Execution Idle Console Feedback: Syntax error Invalid syntax on line 2 Syntax Error Run BlocksSplitTextC Reset Upload History 1 for name in names: 2 message"Hello "+name names"Harry", "Hermione "Ron"] 4 print (message) #32.5) For BlockPy: #32.2) To Your Credit Use a list to represent the courses you are taking by the number of credits they are worth. For instance, this course is worth 3 credits, so your list will have at least one number in it. Then, print out each credit value using a for loop. Server: Saved Execution: Idle Console Feedback: Ready Run " Blocks Split | Text Reset O Upload X History Server Saved BlockPy: #32.3) Temperature Conversion The list of temperatures below are in Celsius. Use the following formula to convert and print each value, using a for loop. Execution: Fahrenheit Celsius 915 32 Console Feedback: Ready Run BlocksSpltText Reset Upload History I temperatures = [10, 20, 5] #32.5) For with Function BlockPy: #32.4) Function with For Define a function print_fahrenheit that consumes a list of Celsius temperatures and uses a for loop to print each element of the list in Fahrenhiet. Use the code below to call this function. Saved Execution: Idle Notice that this function prints instead of returning. You should always read the description of the function carefully. Console Feedback: Ready Run 11 Blocks Split / Text Reset O Upload History print_fahrenheit ([20, 30, 40]) 432.6) Replacing in Loops BlockPy: #32.6) Replacing in Loops Use the replace method on each of the following filenames to turn the dashes into spaces. Server: Saved Idle Execution Console Feedback: Ready Run BlocksSplt Text Reset Upload History 1 filenames"All-the-Single-Ladies.mp3", 2 "Call-Me-Maybe.mp3" Chicken-Dance.mp3"] #32.5) For with Function Saved BlockPy: #32.1) Hello Names The for loop below is meant to print out each value of the list with a mesage However, the lines of code are out of order. Correct the order of the lines and fix any indentation. Server Execution Idle Console Feedback: Syntax error Invalid syntax on line 2 Syntax Error Run BlocksSplitTextC Reset Upload History 1 for name in names: 2 message"Hello "+name names"Harry", "Hermione "Ron"] 4 print (message) #32.5) For BlockPy: #32.2) To Your Credit Use a list to represent the courses you are taking by the number of credits they are worth. For instance, this course is worth 3 credits, so your list will have at least one number in it. Then, print out each credit value using a for loop. Server: Saved Execution: Idle Console Feedback: Ready Run " Blocks Split | Text Reset O Upload X History Server Saved BlockPy: #32.3) Temperature Conversion The list of temperatures below are in Celsius. Use the following formula to convert and print each value, using a for loop. Execution: Fahrenheit Celsius 915 32 Console Feedback: Ready Run BlocksSpltText Reset Upload History I temperatures = [10, 20, 5] #32.5) For with Function BlockPy: #32.4) Function with For Define a function print_fahrenheit that consumes a list of Celsius temperatures and uses a for loop to print each element of the list in Fahrenhiet. Use the code below to call this function. Saved Execution: Idle Notice that this function prints instead of returning. You should always read the description of the function carefully. Console Feedback: Ready Run 11 Blocks Split / Text Reset O Upload History print_fahrenheit ([20, 30, 40]) 432.6) Replacing in Loops BlockPy: #32.6) Replacing in Loops Use the replace method on each of the following filenames to turn the dashes into spaces. Server: Saved Idle Execution Console Feedback: Ready Run BlocksSplt Text Reset Upload History 1 filenames"All-the-Single-Ladies.mp3", 2 "Call-Me-Maybe.mp3" Chicken-Dance.mp3"]Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started