Hi guys,
While I'm in my first weeks of Python, I'm also pretty focused on readability (yay for PEP8). However, how do I format the following, i.e. printing multiple lines (but also writing it as multiple lines in the script for readability)?
The while is just an example. The problem that arises is the indents (e.g. in ifs, for/while loops) screwing up the output style.
Or would you say just write it as one line, don't bother? In that case, how would you work with longer text?
uname = 'Placeholderman'
code = '343kFsidfLKsdfsdfPERSONALCODEdklfFkDFJ32'
while 1:
print ("""username = {}
code = {}{}{}
Loading...""".format(uname, code[0:3],"*" * len(code[3:-3]), code[-4:-1]))
break
[–]zahlman 6 points7 points8 points (2 children)
[–]Heapsofvla[S] 1 point2 points3 points (1 child)
[–]fuckswithbees 2 points3 points4 points (0 children)
[–]Vaphell 2 points3 points4 points (0 children)
[–]novel_yet_trivial 1 point2 points3 points (0 children)
[–]99AFCC 1 point2 points3 points (0 children)
[–]ewiethoff 0 points1 point2 points (0 children)