Question: please show me step by step in python Task 1 - Define a function called ___to_f, which takes an argument called temp_c, which is a
Task 1 - Define a function called ___to_f, which takes an argument called temp_c, which is a float that represents a temperature in Celsius - The function should calculate the Fahrenheit equivalent of temp_c, and return it - You can go back to Lab 2 - Task 5 to get the required conversion formula, or check online. Task 2 - Define a function called emphasise, which takes three arguments called header, message and width. header and message are both strings, and width is an int. width will have a delault value of 50 , and header and message will both be optional - i.e., empty string as default value - The function should return a string which shows header and message in a box (see examples) - The outer width of the box should be based on the provided width. More specifically, it should be width +4. So, we will use the "=" character, (width +4 ) times, for the first and last lines of the box, as well as the line separating header and message (if applicable) - header should be split up into multiple lines of exactly width characters, until all characters have been displayed. On each of these lines, start with a "=" and a space, then the characters of the string for that line, then another space and another "=" - On the last line (potentially the only line if header is shorter than width), insert extra spaces before the closing "=", if necessary - Words in the strings may get split up, this is okay - message should be added in the same way, except with extra padding lines above and below - Your function should produce the same strings as all the below examples - Your function should not print a string while running. It should simply create and retum it
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
