Question
A. Wind chill is defined by the following formula: Wind Chill = 13.13 + 0.528 T 12.1 V 0.15 + 0.3967 T V 0.155 In
A. Wind chill is defined by the following formula: Wind Chill = 13.13 + 0.528 T 12.1 V 0.15 + 0.3967 T V 0.155 In this formula, T is the temperature in Celsius and V is the wind velocity in kilometers per hour. 1) Define a function WindChill in your template module to calculate the wind chill for any temperature and velocity. For instance, a call to WindChill(20, 30) must the following result, exactly: At -20C and 30 kph winds it feels like -31.02508884265753C Your function should NOT return anything, but print the result. Call your windChill function with arguments -20 for T and 30 for V.
B. 1) Write a function f1 that takes two arguments, a string s and a Boolean b. If b is True then the function prints the string with all letters turned into capital letters, otherwise the function prints the string with lower case letters. Write the calls of the function f1 with the string "I am Ryder", first with b == True and after with b == False. 2) Write a function f2 that takes a string s as argument and: 1. Turns the letters in this string into capitals. 2. Returns True if the first and last characters of the modified string are the same, and False otherwise. Print the result of the call of function f2 with argument "Step on no pets". 3) Write a function f3 that takes a string s as argument and returns the string corresponding to s with the first and last letters removed. Print the result of the call of function f3 with argument
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