29
loading...
This website collects cookies to deliver better user experience
pip install black
pip install git+git://github.com/psf/black
$ black {source_file_or_directory}...
$ python -m black {source_file_or_directory}...
$ black --code "print ( 'hello, black world' )"
print("hello, black world")
$ black -v spell_checker/
spell_checker/pycache ignored: matches the .gitignore file content
spell_checker/init.py wasn't modified on disk since last run.
spell_checker/spell_checker_util.py wasn't modified on disk since last run.
spell_checker/spelling_checker.py wasn't modified on disk since last run.
All done! ✨ 🍰 ✨
3 files left unchanged.
def find_no_in_list(
s,
no
):
s = list(s
)
for i in range(len(s) - 1):
if s[i] == no:
return i
else:
return -1
if name == "main":
print(
find_no_in_list([1,
2,
3,
4],
3)
)
$ black black_test.py
Output file:
def find_no_in_list(s, no):
s = list(s)
for i in range(len(s) - 1):
if s[i] == no:
return i
else:
return -1
if name == "main":
print(find_no_in_list([1, 2, 3, 4], 3))