-1

I need to write a program that displays Celsius to Fahrenheit temperature conversion in a table.

Question - What is the correct way to print a specific index within a list. My attempt comes from the answer to a similar exercise outlined here. Thanks in advance.

This is my code

temp = range(0 , 101, 10)
tbl = []
tbl2 = []
for i in temp:
    cel = i
    tbl.append(cel)
    fah = (i * 9/5) + 32
    tbl2.append(fah)
    print(cel, fah)

print('Celsius\t\tFahrenheit')
print('-------------------')
print(tbl(0) + ':\t\t', tbl2(0))
print('-------------------')

This is my output enter image description here

Centiflow
  • 21
  • 2

1 Answers1

2

Functions are called with parenthesis(). Indexes are accessed with with brackets[0]:

print(tbl[0] + ':\t\t', tbl2[0])
James Ng
  • 136
  • 3