-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
> > Co-authored-by: Onkar Dixit <osdixit@gmail.com> Co-authored-by: Vladyslav Krylasov <vladyslav.krylasov@gmail.com>
- Loading branch information
1 parent
1abd194
commit f9c426f
Showing
4 changed files
with
13 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
if __name__ == '__main__': | ||
user = input('Enter user name: ') | ||
print(f'Hello, {user}') | ||
exit(0) # [consider-using-sys-exit] | ||
if __name__ == "__main__": | ||
user = input("Enter user name: ") | ||
print(f"Hello, {user}") | ||
exit(0) # [consider-using-sys-exit] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import sys | ||
|
||
if __name__ == '__main__': | ||
user = input('Enter user name: ') | ||
print(f'Hello, {user}') | ||
if __name__ == "__main__": | ||
user = input("Enter user name: ") | ||
print(f"Hello, {user}") | ||
sys.exit(0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
var = 1 | ||
|
||
|
||
def foo(): | ||
global var # [global-statement] | ||
global var # [global-statement] | ||
var = 10 | ||
print(var) | ||
|
||
|
||
foo() | ||
print(var) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
var = 1 | ||
|
||
def foo(x): | ||
|
||
def foo(): | ||
print(var) | ||
return 10 | ||
|
||
|
||
var = foo() | ||
print(var) |