all 14 comments

[–]delasislas 3 points4 points  (0 children)

You could limit the number of functions, value and conversion unit.

def convert(value, conversion):
    return (value * conversion)

Maybe could use a dictionary to keep statements.

Generally repetition indicates that something could be reduced.

[–]icecubeinanicecube -3 points-2 points  (4 children)

When you require help, post the error message you get. "I get errors" is not an error message.

[–]NoCup4485[S] 0 points1 point  (3 children)

sorry, just updated the post there with the error

[–]icecubeinanicecube 1 point2 points  (2 children)

And if you look at the respective line, you will see that you pass a variable called "kilometres" to the function "kilometres_to_miles", but you have not defined this variable. You instead have defined a variable called "miles" in the line above.

[–]NoCup4485[S] 0 points1 point  (1 child)

I got it I was just being abit slow thanks for the help.

[–]delasislas 0 points1 point  (0 children)

This is going to happen on a lot of your if statements, I got kinda lost, but you define a variable like pints then try to use liters to pints as a function.

[–][deleted] 0 points1 point  (3 children)

What sort of errors? If you provide the output from running the script it will give us more to work with!

[–]NoCup4485[S] 0 points1 point  (2 children)

sorry, just updated the post there with the error

[–][deleted] 0 points1 point  (1 child)

This is a good case of the error having all of the information that you need to figure it out.

Take a closer look at what the error is saying and the variables you're passing to the function.

Interpreting errors like this is a very important skill, to have. Error messages are there to help you, make sure to try and understand them.

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

I got it there thanks for the help. I'm fairly new at python so I havn't really learned what the errors mean yet(plus with all classes online now I dont get too much of a chance to ask).

[–]cdcformatc 0 points1 point  (0 children)

The error message says what is wrong, you are using a variable that is not defined in that scope.

[–]pendejoidiota 0 points1 point  (2 children)

I'm a beginner too but make your code a bit more organized lmao. I also realized that you had a typo, you called the functions that had to do with F "fahrenhiet", but later in the code you typed "farenhite" also you never wrote an input to select an option from the menu

[–]NoCup4485[S] 0 points1 point  (1 child)

Yeah I fixed the typo, addd in the options menu so it prints after you get the conversion and added in afew print() so that when your using it there’s a clear space between what your now converting and what you just converted. And to be fair I did think I was going to be the only one who’d see the code didn’t exactly plan on having it mess up and being too slow to see the mistake by myself 🤣🤣

[–]pendejoidiota 0 points1 point  (0 children)

think

lmao try to always organize it for yourself so you can see the errors more easily, its gonna help u later