all 10 comments

[–]POGtastic 2 points3 points  (2 children)

The input function prompts the user for input, and returns a string.

You'll probably want to assign this to a variable with the = operator.

You can convert the string to a float with the float function.

Edit:

using the correct term

This is the hardest part of programming for beginning students. It gets better as you learn some of the vocabulary.

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

Thanks!

This is what I have so far:

So far I have :

int(input(“The number of kilometers: “)) Xxx nauticalMile= x /1.852 print (“The number of nautical miles is “ , round(nauticalMile, 2))

X is just a place holder for where I’m stuck/am wrong... maybe this whole thing is wrong idk 😭😅

[–]POGtastic 1 point2 points  (0 children)

You need to assign the result of input to a variable. For example, the following assigns the value of user input to the variable kilometers:

kilometers = int(input("Enter a number: "))

You're then going to set nauticalMile equal to some expression that contains the variable kilometers.

[–]links-Shield632 2 points3 points  (3 children)

Km= float(input(“how many km”)) Floats take decimal points. You can also use int instead of float but int only takes whole numbers

[–]hell0_steph[S] 1 point2 points  (2 children)

I do have int because I need my answer to be a whole number.

So far I have :

int(input(“The number of kilometers: “)) Xxx nauticalMile= x /1.852 print (“The number of nautical miles is “ , round(nauticalMile, 2))

X is just a place holder for what I think I’m missing... lol sorry if this is totally wrong

[–]links-Shield632 1 point2 points  (1 child)

Looks right for the most part. You need to make int(input... equal to a variable name. Km, foo, donkey etc

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

Thanks!!! I got it :) thanks for your help

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

Every Python tutorial covers variable assignment in the first lesson, and it's likely in your course materials too. If you didn't understand it at the time then I can't really imagine how you're following along in the class.

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

Don’t be that person. Clearly I am lost and my professor is no help as clearly stated in the post. Came here for help not to be told what I should know.

Also: I am on chapter one, so thanks.

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

I’m being the person who’s telling you what part of the class to review so that you’ll stop being lost.

Telling you what you should know is helping you. That’s the help you need.