# %%writefile celsius_to_fahrenheit.py# Written by Zerek for COMP9021# Prints out a conversion table of temperatures from Fahrenheit# to Celsius degrees, with the former ranging from 0 to 300 in# steps of 10.
min_temperature =0
max_temperature =100
step =10# \t: A tabprint('Celsius\tFahrenheit')# up to the largest value smaller than max_temperature + stepfor celsius inrange(min_temperature, max_temperature + step, step):
fahrenheit = celsius *9/5+32print(f'{
celsius:7}\t{
fahrenheit:10.0f}')
Practice2 max_element_and_span_in_a_list:
# %%writefile span_in_list.py# wirtten by Zerekfrom random import seed, randint
import sys
# Prompts the user for an integer to provide as argument to the# seed() function.try:
arg_for_seed =int(input('Feed the seed with an integer: '))except ValueError:print('Input is not an integer, giving up.')
sys.exit()# Prompts the user a strictly positive number, nb_of_elements.try:
nb_of_elements =int(input('How many elements do you want to generate? '))except ValueError:print('Input is not an integer, giving up.')
sys.exit()if nb_of_elements <=0:print('Input should be strictly positive, giving up.')
sys.exit()
seed(arg_for_seed)# Generates a list of nb_of_elements random integers between 0 and 99.
L =[randint(0,99)for _ inrange(nb_of_elements)]# Prints out the list.print('\nThe list is:', L)# Computes the maximum element of the list without using the# builtin max().
max_element =0
min_element =99for e in L:if e > max_element:
max_element = e
if e < min_element:
min_element =
Practice1temperature_conversions:# %%writefile celsius_to_fahrenheit.py# Written by Zerek for COMP9021# Prints out a conversion table of temperatures from Fahrenheit# to Celsius degrees, with the former ranging from 0 to 300 in# steps of 10.min