Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

ValuePython Expression
Hexa decimal a10xa1

3.2e-12
  • Horizontal Tab character
  • Newline (ASCII Linefeed) character
  • The character with hexadecimal value a0
  • '\t\n\xa0'
  • "\t\n\xa0"
  • '''\t\n\xa0'''
  • """\t\n\xa0"""

String

String concatenation by join()

Write the code for a Python function expand(x) that takes a list of strings, concatenates them, and returns the resulting string repeated three times.

Info
  • Input: ['string1', 'string2']
  • Output: 'string1string2string1string2string1string2'


Code Block
def expand(x):
    return ''.join(x) * 3


Basic Operators

Python Arithmetic Operators

...