I saw part of code like this:
from typing import List
c: List[float] = [7.3, 1.2, 2.6, 9.9, 'a']
type(c[3])
type(c[4])
output: (float, str)
- What if the means of
List[float]
? - The last element in the list if not float, so why we are not getting any error ?
- When we should use this kind of code ?