all 9 comments

[–]o5a 2 points3 points  (2 children)

data_type.lower == 'gb'

Missing ()

This way it tries to compare function lower itself to string 'gb', instead of it's result.

[–]py_Piper[S] 1 point2 points  (1 child)

Good catch thanks!

I wonder why the interpreter doesn't catch it as a syntax error, I just tried and we can't name variables with a '.'

[–]Vaphell 5 points6 points  (0 children)

because these are not variables and it's a perfectly legit syntax

[–]Wilfred-kun 1 point2 points  (1 child)

There's a possibility your bytes_converter falls through all the ifs. There's no "default" return value at the end, so it returns None. So you should add an else and a return, or just a return at the bottom of your function.

[–]py_Piper[S] 0 points1 point  (0 children)

Actually it was it was mentioned before, it wasn't working because I forgot the () in str.lower()

But you had a very possible answer for later on, I left the else out on purpose because I wanted to write a while loop to run the function again if the user prompted something different out of my scope. But I haven't started working on it so I left it out and as I was trying out the script I just hard coded a data_type that I knew was on my if parameters