Python Forum

Full Version: input inbetween two strings?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I would like advice on how i can have a second string at the end of the input area in the bellow code.
What i am trying to do is have "Enter items weight" _ "lbs"
The underscore is were the number will be input.

This is what i currently have without the "lbs"
pounds = int(input("Enter item weight "))
Take a look at curses module. Not sure, but I think it can be useful for this task.
(Sep-23-2020, 12:16 AM)scidam Wrote: [ -> ]Take a look at curses module. Not sure, but I think it can be useful for this task.

I took a look and at my level of knowledge i dont see anything that can translate as a solution to the problem. You probably are on to something with it because after searching around for solutions i have seen at least two other questions like this answered with reference to curses module.

Very funny, something seemingly simple is quite complicated.Think
Simpler do something like this.
>>> pounds = int(input("Enter item weight in lbs: "))
Enter item weight in lbs: 75

>>> pounds = f'Your input weight was {pounds} lbs'
>>> pounds
'Your input weight was 75 lbs'