Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Multi line string with arguments. How to declare?
- cmd = """line 1
- line 2
- line 3"""
- cmd = """line %d
- line %d
- line %d""" % (1, 2, 3)
- cmd = """line %d
- line %d
- line %d""" % (
- 1,
- 2,
- 3)
- '''line {0}
- line {1}
- line {2}'''.format(1,2,3)
- args = (1,2,3)
- '''line {0}
- line {1}
- line {2}'''.format(*args)
- args = {'arg1':1, 'arg2':2, 'arg3':3}
- '''line {arg1}
- line {arg2}
- line {arg3}'''.format(**args)
- cmd = "line %dn"%1 +
- "line %dn"%2 +
- "line %dn"%3
- cmd = "n".join([
- "line %d"%1,
- "line %d"%2,
- "line %d"%3])
- cmd = """line %d
- line %d
- line %d""" % (
- 1,
- 2,
- 3
- )
Advertisement
Add Comment
Please, Sign In to add comment