mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-08-29 17:40:42 +02:00
Fixed whitespaces
Fixed the spacing to conform with standards.
This commit is contained in:
@@ -158,7 +158,7 @@ print("I'm Python. Nice to meet you!")
|
|||||||
|
|
||||||
# By default the print function also prints out a newline at the end.
|
# By default the print function also prints out a newline at the end.
|
||||||
# Use the optional argument end to change the end character.
|
# Use the optional argument end to change the end character.
|
||||||
print("I'm Python. Nice to meet you!", end="")
|
print("Hello, World", end="!") # => Hello, World!
|
||||||
|
|
||||||
# No need to declare variables before assigning to them.
|
# No need to declare variables before assigning to them.
|
||||||
# Convention is to use lower_case_with_underscores
|
# Convention is to use lower_case_with_underscores
|
||||||
@@ -501,9 +501,8 @@ all_the_args(*args, **kwargs) # equivalent to foo(1, 2, 3, 4, a=3, b=4)
|
|||||||
|
|
||||||
# Returning multiple values (with tuple assignments)
|
# Returning multiple values (with tuple assignments)
|
||||||
def swap(x, y):
|
def swap(x, y):
|
||||||
return y, x # Return multiple values as a tuple
|
return y, x # Return multiple values as a tuple without the parenthesis.
|
||||||
# (Note: parenthesis have been excluded but can be included)
|
# (Note: parenthesis have been excluded but can be included)
|
||||||
# return (y, x) # Just as valid as the above example.
|
|
||||||
|
|
||||||
x = 1
|
x = 1
|
||||||
y = 2
|
y = 2
|
||||||
|
Reference in New Issue
Block a user