# data[].attributes.attachment_link.readable_text
#!/usr/bin/env python
# coding: utf-8

# In[1]:


import tkinter as tk
def hien_thi_thong_tin():
    #ho_ten = entry_ho_ten.get()
    nam_sinh = int(entry_nhap_nam_sinh.get())
    tuoi = 2024 - nam_sinh
    label_ket_qua.config(text = f"Tu���i c���a b���n l��:  {tuoi}")
#c���a s���
app = tk.Tk()
app.title("Nh���p th��ng tin")

#nh��n
label_huong_dan = tk.Label(app, text="Nh���p h��� t��n c���a b���n")
label_huong_dan.pack()
#�� nh���p
entry_ho_ten = tk.Entry(app)
entry_ho_ten.pack()

label_huong_dan = tk.Label(app, text="Nh���p n��m sinh c���a b���n")
label_huong_dan.pack()
entry_nhap_nam_sinh = tk.Entry(app)
entry_nhap_nam_sinh.pack()
#n��t hi���n th���
button_hien_thi_thong_tin = tk.Button(app, text = "Nh���n ����� xem tu���i c���a b���n", command=hien_thi_thong_tin)
button_hien_thi_thong_tin.pack()

label_ket_qua = tk.Label()
label_ket_qua.pack()
app.mainloop()


# In[ ]:

# data[].attributes.attachment_link.readable_text
#!/usr/bin/env python
# coding: utf-8

# In[2]:


import tkinter as tk
def tinh_tong():
    a = float(entry_a.get())
    b = float(entry_b.get())
    
    #t��nh t���ng
    tong = a + b
    
    thong_tin_hien_thi.config(text = f"T���ng: {tong}")
#t���o c���a s���
app = tk.Tk()
app.title("Ch����ng tr��nh t��nh t���ng")

#T���o �� nh���p li���u
nhan_a = tk.Label(app, text = "Nh���p a ")
entry_a = tk.Entry(app)

nhan_b = tk.Label(app, text = "Nh���p b ")
entry_b = tk.Entry(app)

#N��t t��nh t���ng
nut_tinh_tong = tk.Button(app, text = "T��nh t���ng", command = tinh_tong)
#Hi���n th��� th��ng tin k���t qu���
thong_tin_hien_thi = tk.Label(app, text = "T���ng: ")

#b��� c���c tr��n c���a s��� app
nhan_a.grid(pady=10)
entry_a.grid(pady=5)

nhan_b.grid(pady=10)
entry_b.grid(pady=5)

nut_tinh_tong.grid(pady=5)
thong_tin_hien_thi.grid(pady=5)

app.mainloop()


# In[ ]:

# data[].attributes.attachment_link.readable_text
#!/usr/bin/env python
# coding: utf-8

# In[19]:


def hien_thi_menu():
    print('=========MENU========')
    print('1. G�� r��n - 30.000��')
    print('2. Humburger - 25.000��')
    print('3. Coca Cola - 10.000��')
    print('=========h���t========')
def nhap_so_luong():
    so_luong_garan = int(input('Nh���p s��� l�����ng G�� r��n: '))
    so_luong_humburger = int(input('Nh���p s��� l�����ng Humburger: '))
    so_luong_coca = int(input('Nh���p s��� l�����ng Coca Cola: '))
    return so_luong_garan, so_luong_humburger, so_luong_coca
def in_hoa_don(so_luong_garan, so_luong_humburger, so_luong_coca):
    gia_garan = 30000
    gia_humburger = 25000
    gia_coca = 10000
    
    thanh_tien_garan = so_luong_garan * gia_garan
    thanh_tien_humburger = so_luong_humburger * gia_humburger
    thanh_tien_coca = so_luong_coca * gia_coca
    
    tong_tien = thanh_tien_garan + thanh_tien_humburger + thanh_tien_coca
    print('=========H��A ����N========')
    print(f'{so_luong_garan} G�� r��n: {thanh_tien_garan}��')
    print(f'{so_luong_humburger} G�� r��n: {thanh_tien_humburger}��')
    print(f'{so_luong_coca} G�� r��n: {thanh_tien_coca}��')
    print('========================')
    print(f'T���ng c���ng: {tong_tien}')
    print('========================')
def main():
    hien_thi_menu()
    so_luong_garan, so_luong_humburger, so_luong_coca = nhap_so_luong()
    in_hoa_don(so_luong_garan, so_luong_humburger, so_luong_coca)
main()


# In[ ]:

# data[].attributes.attachment_link.readable_text
#!/usr/bin/env python
# coding: utf-8

# In[2]:


import random
danhsach = []
def tao_danh_sach_ngau_nhien(n):
    ds = [random.randint(1,100)for _ in range (n)]
    return ds
def so_lon_nhat(ds):
    solonnhat = ds[0]
    for so in ds:
        if so > solonnhat:
            solonnhat = so
    return solonnhat
    return solonnhat
def so_nho_nhat(ds):
    sonhonhat = ds[0]
    for so in ds:
        if so < sonhonhat:
            sonhonhat = so
    return sonhonhat        
so_phan_tu = 10
danhsach_ngaunhien=tao_danh_sach_ngau_nhien(so_phan_tu)
print(danhsach_ngaunhien)
so_lon = so_lon_nhat(danhsach_ngaunhien)
print(so_lon)
so_be = so_nho_nhat(danhsach_ngaunhien)
print(so_be)
        
        
    


# In[ ]:





# In[ ]:

# data[].attributes.attachment_link.readable_text
#!/usr/bin/env python
# coding: utf-8

# In[14]:


import random
def tao_ds_ngau_nhien(n):
    danhsach = [random.randint(1, 100) for _ in range(n)]
    return danhsach
#.............................
def tim_so_lon_nhat(ds):
    so_lon_nhat = ds[0]
    for so in ds:
        if so > so_lon_nhat:
            so_lon_nhat = so
    return so_lon_nhat
#......................
def tim_so_nho_nhat(ds1):
    so_nho_nhat = ds1[0]
    for so in ds1:
        if so < so_nho_nhat:
            so_nho_nhat = so
    return so_nho_nhat
#........................
so_phan_tu = 10
danhsach_ngaunhien = tao_ds_ngau_nhien(so_phan_tu)
print(danhsach_ngaunhien)
somax = tim_so_lon_nhat(danhsach_ngaunhien)
print(somax)
somin = tim_so_nho_nhat(danhsach_ngaunhien)
print(somin)
###t��nh t���ng c��c s��� ch���n, t��nh t���ng c��c s��� l���, �����m xem c�� bao nhi��u s��� ch���n


# In[ ]:

# data[].attributes.attachment_link.readable_text
#!/usr/bin/env python
# coding: utf-8

# In[10]:


import random
def tao_ds_ngau_nhien(n):
    danhsach = [random.randint(1, 100) for _ in range(n)]
    return danhsach
#.............................
def tim_so_lon_nhat(ds):
    so_lon_nhat = ds[0]
    for so in ds:
        if so > so_lon_nhat:
            so_lon_nhat = so
    return so_lon_nhat
#......................
so_phan_tu = 10
danhsach_ngaunhien = tao_ds_ngau_nhien(so_phan_tu)
print(danhsach_ngaunhien)
somax = tim_so_lon_nhat(danhsach_ngaunhien)
print(somax)


# In[ ]:

# data[].attributes.attachment_link.readable_text
#!/usr/bin/env python
# coding: utf-8

# In[ ]:


def nhap_danh_sach():
    ds =[]
    so_luong = int(input(b���n h��y nh���p s��� l����ng ph���n t���))
    for i in range(so_luong):
        phan_tu = int(input(f'nh���p ph���n t�� th���'{i=1}))
        ds.append(phan_tu)
    return ds

def tinh_tong(danh_sach):
    return sum(danh_sach)

def so_lon_nhat(ds)
    return max(ds)

def dem_so_5(danh_sach):
    dem = 0
    for i in danh_sach
        if i == 5:
            dem + 1
        return dem
danh-sach_nhap = nhap_danh_sach()
print(danh-sach_nhap)
tong_danh_sach = tinh_tong(danh_sach_nhap)
print(tong_danh-sach)
so_lon_nhat = so_lon_nhat(danh-sach_nhap)
print(so_lon_nhat)
dem_so_luong = dem_so_5(danh-sach_nhap)
print(dem_so_luong)

# data[].attributes.attachment_link.readable_text
#!/usr/bin/env python
# coding: utf-8

# In[28]:


"""H��m Nh���p m���t danh s��ch t��� b��n ph��m, H��m t��nh t���ng c��c s��� trong danh s��ch, h��m t��m 
s��� l���n nh���t trong danh s��ch, h��m �����m xem c�� bao nhi��u s��� 5 trong danh s��ch"""
def nhap_danh_sach():
    ds = []
    so_luong = int(input('B���n h��y nh���p s��� l�����ng ph���n t��� c���a danh s��ch: '))
    for i in range(so_luong):
        phan_tu = int(input(f'Nh���p ph���n t��� th��� {i+1}: '))
        ds.append(phan_tu)
    return ds
def tinh_tong(danhsach):
    return sum(danhsach)

def so_lon_nhat(ds):
    return max(ds)

def dem_so_5(danh_sach):
    dem = 0
    for i in danh_sach:
        if i == 5:
            dem += 1
    return dem

#...............
danh_sach_nhap = nhap_danh_sach()
print(f'danh s��ch b���n nh���p l��: {danh_sach_nhap}')
    #...............
tong_danh_sach = tinh_tong(danh_sach_nhap)
print(f'T���ng ph���n t��� trong danh s��ch l��: {tong_danh_sach}')
    #...............
lon_nhat = so_lon_nhat(danh_sach_nhap)
print(f's��� l���n nh���t trong danh s��ch l��: {lon_nhat}')
    #...............
dem_so_luong = dem_so_5(danh_sach_nhap)
print(f's��� l�����ng ph���n t��� b���ng 5 l��: {dem_so_luong}')


# ##### 