I am trying to solve this challenge about error-handling. Maybe I'm way off!

The challenge description:

> 
> Write a function called "load\_file" that accepts one parameter: a filename. The function should open the file and return the contents.
> 
> 
> If the contents of the file can be interpreted as an integer, return the contents as an integer. Otherwise, if the contents of the file can be interpreted as a float, return the contents as a float. Otherwise, return the contents of the file as a string.
> 
> 
> You may assume that the file has only one line.
> 
> 
> 

I get ValueError: could not convert string to float: "b>a!\{\'"

Am I all wrong about the error-handling?

```
def load_file(file):

    file = open(file, "r")
    all_lines = file.read()

    try:        
        return int(all_lines)

    except ValueError:
        return float(all_lines)

    else:
        return all_lines

    file.close()

```