Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

readme.md

Birden Çok Input

  • Fonksiyonların birden çok parametresi olabilir.
def square(x):
    return x *x
square(3)
9
def power(x, y):
    
    return x ** y
    
power(2, 3)
8

Birden Çok Değer Döndüren Fonksiyonlar

def f(x):
    
    return 2*x, 10*x
f(10)
(20, 100)
  • Bana sonucu tuple olarak döndürdü.

  • Variable Unpacking kısmında gördüğümüz gibi bu iki değeri farklı değişkenlere eşitleyebilirim.

a, b = f(10)
a
20
b
100
def f(x,y):
    
    return 2*x*y, (10*x)**y
f(10,2)
(40, 10000)