# -*- coding: utf-8 -*-
"""
Spyder Editor

This is a temporary script file.
"""

#%%
a=2
print(a)


#%%
b=4
print("b =",b)


#%%
a = input("Podaj liczbe a=")
a1 = float(a)



#%%
a = float(input("Podaj liczbe a="))
b = float(input("Podaj liczbe b="))

print("suma a i b ", a+b)



#%%
a = int(input("Podaj liczbe a="))
b = int(input("Podaj liczbe b="))

print("suma a i b ", a+b)



#%%
def WczytajLiczbe():
    a = float(input("Podaj liczbe a="))
    return a
    
    
    
x = WczytajLiczbe()
print(x)     

#%%
def WczytajLiczbe(lancuch):
    a = float(input(lancuch))
    return a
    
    
    
x = WczytajLiczbe("Podaj liczbe x=")
y = WczytajLiczbe("Podaj liczbe y=")
print("Suma liczb  ", x+y)     
    
#%%
def WczytajLiczbe(lancuch):
    a = float(input(lancuch))
    return a
    
    
    
a = WczytajLiczbe("Podaj liczbe a=")
b = WczytajLiczbe("Podaj liczbe b=")
x = WczytajLiczbe("Podaj liczbe x=")
print("wynik=  ", a*x+b)

#%%
def WczytajLiczbe(lancuch):
    a = float(input(lancuch))
    return a
    
def wczytaj3liczby():
    a = WczytajLiczbe("Podaj liczbe a=")
    b = WczytajLiczbe("Podaj liczbe b=")
    x = WczytajLiczbe("Podaj liczbe x=")    
    return a, b, x

def liniowa(a,b,x):
    wynik = a*x+b
    return wynik

a,b,x=wczytaj3liczby()

print("wynik= ", liniowa(a,b,x))

#%%
def WczytajLiczbe(lancuch):
    a = float(input(lancuch))
    return a
    
def wczytaj4liczby():
    a = WczytajLiczbe("Podaj liczbe a=")
    b = WczytajLiczbe("Podaj liczbe b=")
    c = WczytajLiczbe("Podaj liczbe c=")
    x = WczytajLiczbe("Podaj liczbe x=")    
    return a, b, c, x

def kwadratowa(a,b,c,x):
    wynik = a*x**2+b*x+c
    return wynik


a,b,c,x=wczytaj4liczby()

print("wynik= ", kwadratowa(a,b,c,x))

#%%
def WczytajLiczbe(lancuch):
    a = float(input(lancuch))
    return a
    
def wczytaj4liczby():
    a = WczytajLiczbe("Podaj liczbe a=")
    b = WczytajLiczbe("Podaj liczbe b=")
    c = WczytajLiczbe("Podaj liczbe c=")
    x = WczytajLiczbe("Podaj liczbe x=")    
    return a, b, c, x

def kwadratowa(a,b,c,x):
    wynik = a*x**2+b*x+c
    return wynik

def liniowa(a,b,x):
    wynik = a*x+b
    return wynik

a,b,c,x=wczytaj4liczby()

print("wynik funkcji kwadratowej= ", kwadratowa(a,b,c,x))
print("wynik funkcji liniowej= ", liniowa(a,b,x))

