import examples

This commit is contained in:
Mert Gör 🇹🇷 2023-05-29 15:08:03 +03:00
parent 98b550be8a
commit e8216f9619
No known key found for this signature in database
GPG Key ID: 2100A876D55B39B9
4 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,3 @@
# test.py
print(__name__)

View File

@ -0,0 +1,3 @@
# sample.py
import test

View File

@ -0,0 +1,6 @@
# test.py
if __name__ == '__main__':
print('yorumlayıcı yoluyla çalıştırılmış')
else:
print('import ile çalıştırılmış')

19
python-temel/import.py Normal file
View File

@ -0,0 +1,19 @@
# test.py
def foo():
print('foo')
def bar():
print('bar')
def tar():
print('tar')
def main():
print('program olarak çalışma başladı')
foo()
bar()
tar()
if __name__ == '__main__':
main()