bruno modulix <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > administrata wrote: > > Hello! :) > > I've reading 'Python Programmin for the Absolute beginner'. > > I got questions which is... > > > > print "\t - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - " > > > > rock = """ > > Igneous Sedimentary Metamorphic > > > > Lava Grains Marble > > Ramdom crystals Layer Bands > > Granite Salt Schist > > Intrusive Weathering Heat + Pressure > > Deposition Change""" > > print \trock > > > > print "\t - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - " > > > > error occurs! > > > > I don't know how to \t The variable. > > see Daniel's answer for the why. > Now for the how, I guess you want a tab on each line so you have two > solutions : > 1/ putting the tabs in the string: > rock = """ > \tIgneous Sedimentary Metamorphic > > \tLava Grains Marble > \tRamdom crystals Layer Bands > \tGranite Salt Schist > \tIntrusive Weathering Heat + Pressure > \t Deposition Change""" > > print rock > > 2/ adding the tabs before printing: > rock = """ > Igneous Sedimentary Metamorphic > > Lava Grains Marble > Ramdom crystals Layer Bands > Granite Salt Schist > Intrusive Weathering Heat + Pressure > Deposition Change""" > > > for line in rock.split("\n"): > print "\t%s" % line > > HTH,
thx 4 your helpful msg. I'll input 1 instead of 2 which is a bit complicated for me. -- http://mail.python.org/mailman/listinfo/python-list