Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

please show me step by step in python image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Spatial And Temporal Databases 10th International Symposium Sstd 2007 Boston Ma Usa July 2007 Proceedings Lncs 4605

Authors: Dimitris Papadias ,Donghui Zhang ,George Kollios

2007th Edition

3540735399, 978-3540735397

More Books

Students also viewed these Databases questions