Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
James Dunn
3,041 PointsPutting an input inside of a printed string.
So let me elaborate. This is not related to a code challenge but a question that came up in my own personal experimentation with python.
Below are the relevant lines of codes for this.
__s_input_line = print("\t"*3 + "| {}" + "\t"*3 + "|")
self.s_name = self.input_line.format(input("Enter Name: "))
What I'm trying to achieve is something like this.
| Enter Name: |
|---|
( I can't seem to keep this from doing some kind of text editing when I try to create a box around "Enter Name" the way I am in my program. So please use your imagination. )
The idea being that the cursor for the input is next to the colon after Name. allowing the user to input data inside the box I created.
So is this even possible? If so, am I on the right track?
Thanks gang.
1 Answer
Steven Parker
243,266 PointsOn the first line, if you're trying to build a string to use with "format", you won't need a "print" statement.
If that's not the whole issue, try posting again and be sure to use Markdown formatting to preserve the indentation and special characters in the code.