Python Forum
beverage machine code
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
beverage machine code
#9
Another option comes to mind from the excellent example @ichabod801 gave.

print('Enter money here\n(example 5.00): ', end='')
userCredit = input()
The end=<somestring> in a print function overrides the default \n that is normally output after everything else output by a print() call.

The <somestring> can be pretty much anything (several newlines perhaps). Here, the empty string means that the next bit of output, from the input() function, continues on the same output line. (If there had been any prompting text inside the input() call, that would have appeared first on the same line as the preceding print() output before Python pauses for input.
I am trying to help you, really, even if it doesn't always seem that way
Reply


Messages In This Thread
beverage machine code - by ccm1776 - Sep-26-2018, 05:01 PM
RE: beverage machine code - by ichabod801 - Sep-26-2018, 08:14 PM
RE: beverage machine code - by woooee - Sep-27-2018, 08:23 PM
RE: beverage machine code - by ccm1776 - Sep-27-2018, 09:12 PM
RE: beverage machine code - by ichabod801 - Sep-28-2018, 12:37 AM
RE: beverage machine code - by gruntfutuk - Sep-29-2018, 09:43 AM
RE: beverage machine code - by ccm1776 - Sep-30-2018, 06:29 AM
RE: beverage machine code - by ichabod801 - Sep-30-2018, 11:17 AM
RE: beverage machine code - by gruntfutuk - Sep-30-2018, 11:50 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020