تشخیص اسیدی یا بازی بودن ماده بر اساس پی‌اچ

تمرین آسان 589 visibility link download

برنامه‌ای بنویسید که مقدار pH یک ماده را دریافت کند و مشخص نماید که ماده اسیدی، بازی یا خنثی است. اگر pH کمتر از 7 باشد، خروجی "اسیدی" خواهد بود؛ اگر برابر 7 باشد، "خنثی" و اگر بیشتر از 7 باشد، "بازی".

👨‍💻 17 ساعت قبل کاربر ناشناس این تمرین رو مشاهده کرد

reply 10

```
from tkinter import *
from tkinter import messagebox
from PIL import Image
from PIL import ImageTk

class PH:
def init(self):
self.windo = None
self.image_windo = None
self.icon_windo = None
self.lable_windo = None
self.entry_windo = None
self.dell_btn_windo = None
self.enter_windo = None
self.close_btn_windo = None
self.new_windo = None
self.image_new = None
self.icon_new = None
self.lable_new = None
self.close_btn_new = None

def dell_btn_windo_enter(self,e):
    self.dell_btn_windo.config(background="white",foreground="#FF8C00",cursor="hand2")
def dell_btn_windo_leave(self,e):
    self.dell_btn_windo.config(background="black",foreground="#FF8C00",cursor="arrow")

def enter_btn_windo_enter(self,e):
    self.enter_windo.config(background="white",foreground="#7CFC00",cursor="hand2")
def enter_btn_windo_leave(self,e):
    self.enter_windo.config(background="black",foreground="#7CFC00",cursor="arrow")

def close_btn_windo_enter(self,e):
    self.close_btn_windo.config(background="white",foreground="#6B8E23",cursor="hand2")
def close_btn_windo_leave(self,e):
    self.close_btn_windo.config(background="black",foreground="#6B8E23",cursor="arrow")

def dell_entry(self):
    self.entry_windo.delete(0,END)

def close_windo(self):
    self.windo.destroy()

def close_new_enter(self,e):
    self.close_btn_new.config(background="white",fg="blue",cursor="hand2")
def close_new_leave(self,e):
    self.close_btn_new.config(background="black",fg="blue",cursor="arrow")

def amaliat(self):
    try:
        num = int(self.entry_windo.get())

        if num < int(7):
            natije = "asidi"

        if num == int(7):
            natije = "khonsa"

        if num > int(7):
            natije = "bazi"

        self.new_windo = Toplevel(self.windo)
        self.new_windo.title("natije")
        self.new_windo.geometry("250x250")
        self.new_windo.config(background="black")
        self.new_windo.resizable(False,False)

        self.image_new =Image.open("image/download (3).png")
        self.icon_new = ImageTk.PhotoImage(self.image_new)
        self.new_windo.iconphoto(False,self.icon_new)

        self.lable_new = Label(self.new_windo,text=natije,font=("arial",14),bg="black",fg="#DAA520",width=13)
        self.lable_new.pack(padx=10,pady=20)



        self.close_btn_new = Button(self.new_windo,text="

reply ارسال جواب

  • قبل از ارسال جواب ویدیو زیر رو ببین تا کار کردن با markdown رو یاد بگیری
  • لطفا جواب های تکراری ارسال نکن
  • در متن جواب اطلاعات شخصی شامل ایمیل و شماره موبایل و آی دی و... ننویس
  • سعی کن داخل کدت از کلمات فارسی یا فینگلیش (فارسی با حروف انگلیسی) استفاده نکنی و کدت تماما انگلیسی باشه
  • لطفا داخل جواب از ایموجی یا کاراکترهای خاص استفاده نکن
  • ارسال جواب حق مادی یا معنوی برای ارسال کننده ایجاد نمیکند و تمام حقوق برای سایت کدبزن محفوظ است

راهنمای ارسال جواب 👇

×
بستن