Skip to main content
Edited title and removed language tag.
Link
martineau
  • 124.1k
  • 29
  • 181
  • 319

Proper indentation for Python multiline strings?

deleted 11 characters in body
Source Link
Remi Guan
  • 22.5k
  • 17
  • 68
  • 90

What is the proper indentation for Python multiline strings within a function?

 def method(): string = """line one line two line three""" 

or

 def method(): string = """line one line two line three""" 

or something else?

It looks kind of weird to have the string hanging outside the function in the first example.

Thanks.

What is the proper indentation for Python multiline strings within a function?

 def method(): string = """line one line two line three""" 

or

 def method(): string = """line one line two line three""" 

or something else?

It looks kind of weird to have the string hanging outside the function in the first example.

Thanks.

What is the proper indentation for Python multiline strings within a function?

 def method(): string = """line one line two line three""" 

or

 def method(): string = """line one line two line three""" 

or something else?

It looks kind of weird to have the string hanging outside the function in the first example.

Added parenthesis to make correct Python syntax for functions, since this was destracting to question.
Source Link
Brian Neal
  • 32.5k
  • 7
  • 58
  • 60

What is the proper indentation for Python multiline strings within a function?

 def method(): string = """line one line two line three""" 

or

 def method(): string = """line one line two line three""" 

or something else?

It looks kind of weird to have the string hanging outside the function in the first example.

Thanks.

What is the proper indentation for Python multiline strings within a function?

 def method: string = """line one line two line three""" 

or

 def method: string = """line one line two line three""" 

or something else?

It looks kind of weird to have the string hanging outside the function in the first example.

Thanks.

What is the proper indentation for Python multiline strings within a function?

 def method(): string = """line one line two line three""" 

or

 def method(): string = """line one line two line three""" 

or something else?

It looks kind of weird to have the string hanging outside the function in the first example.

Thanks.

Source Link
ensnare
  • 42.5k
  • 67
  • 170
  • 231
Loading