0% found this document useful (0 votes)
4 views1 page

COMP1126 Tutorial 1b

The document contains a tutorial for COMP1126 at The University of the West Indies, focusing on Python programming tasks. It includes three questions: a function to convert Celsius to Fahrenheit, a function to determine if a day is cold based on Fahrenheit temperature, and additional functions for manipulating numerical values. Each question outlines specific requirements for the functions to be implemented.

Uploaded by

conrod.smith
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views1 page

COMP1126 Tutorial 1b

The document contains a tutorial for COMP1126 at The University of the West Indies, focusing on Python programming tasks. It includes three questions: a function to convert Celsius to Fahrenheit, a function to determine if a day is cold based on Fahrenheit temperature, and additional functions for manipulating numerical values. Each question outlines specific requirements for the functions to be implemented.

Uploaded by

conrod.smith
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

THE UNIVERSITY OF THE WEST INDIES

Department of Computing
COMP1126–Introduction to Computing I
Tutorial 1B

Question 1
Write a function in python calcFahrenheit that converts Celsius temperature to Fahrenheit
temperatures. The formula is as follows:
9
F  C  32
5
The program takes a Celsius value as an argument and returns the equivalent Fahrenheit value.

Question 2
A function is_coldday takes the temperature as Fahrenheit value as an argument and returns true if
the temperature is less than 50o F and false otherwise.

Question 3
Write python functions to capture the process descriptions given below:
1. A function of one argument that returns double the value of the argument.
2. A function of two arguments that returns the smaller of them.
3. A function of two arguments that returns 1 if the first argument is negative, but the second
argument otherwise.

You might also like