���P���]
�����܌������n�̸��dȤ
Python��λ�C�_�l(f��)�̳�

��105С��(ji��)����8618�ˌW�^

Python��λ�C�_�l(f��)���֧�l���Z��
�l(f��)���r�g:2024-11-20 09:29 [ ��Ҫ�ԌW�Wԭ��(chu��ng) ] �l(f��)����: �옷СŮ ��x: 110

'''
���֧�l���Z��Ļ����Y���� if-elif-else ��

if �l��1:
    # ���l��1 ����r��(zh��)�еĴ��a
elif �l��2:
    # �� �l��1 ��٣��l��2 ����r��(zh��)�еĴ��a
elif �l��3:
    # �� �l��1 �� �l��2 ��������l��3 ����r��(zh��)�еĴ��a
...
else:
    # �����Зl������ٕr��(zh��)�еĴ��a

���{Ҫ�c
�l����������Ҫ���șz�������������ėl����
ֻ��һ����֧�Ĵ��a������(zh��)����һ��ij���l���M�㣬���m(x��)�ėl�����ٙz����
else �ǿ��x�ģ�����ijЩ��r�¿���̎������ǰ��l�������M�����r��ʹ߉݋��������

#python3.10 ֮���ṩ��match - case �Z��

match expression:
    case pattern1:
        # ��(zh��)�еĴ��a�K 1
    case pattern2:
        # ��(zh��)�еĴ��a�K 2
   ...
    case _:
        # ������ǰ���ģʽ����ƥ��r��(zh��)�е�Ĭ�J���a�K


'''

score = 40

# if score >= 90:
#     print("��(y��u)��")
# elif score >= 80:
#     print("����")
# elif score >= 70:
#     print("�е�")
# elif score >= 60:
#     print("����")
# else:
#     print("������")

# match score:
#     case score if score>=90:
#         print("��(y��u)��")
#     case score if score>=80:
#         print("����")
#     case score if score>=70:
#         print("�е�")
#     case score if score>=60:
#         print("����")
#     case _:
#         print("������")









from PySide6.QtWidgets import *
from PySide6.QtCore import *

class MainWindow(QWidget):
    def __init__(self):
        super(MainWindow, self).__init__()

        self.setWindowTitle("���l����֧ʾ��")
        self.resize(500,300)

        # ��(chu��ng)�����o
        self.button1 = QPushButton("���o 1",self)
        self.button2 = QPushButton("���o 2",self)
        self.button3 = QPushButton("���o 3",self)

        # �[��λ��
        self.button1.setGeometry(40,40,80,30)
        self.button2.setGeometry(40,80,80,30)
        self.button3.setGeometry(40,120,80,30)



        # �B�Ӱ��o���c����̖���ۺ���
        self.button1.clicked.connect(self.on_button_clicked)
        self.button2.clicked.connect(self.on_button_clicked)
        self.button3.clicked.connect(self.on_button_clicked)

    def on_button_clicked(self):
        # �����l(f��)����̖�Č��󣨰��o����(zh��)�в�ͬ�IJ���,sender() �����@ȡ���l(f��)���@����̖�Č���
        sender = self.sender()
        # if sender == self.button1:
        #     QMessageBox.information(self, "��Ϣ", "���c���˰��o 1")
        # elif sender == self.button2:
        #     QMessageBox.information(self, "��Ϣ", "���c���˰��o 2")
        # elif sender == self.button3:
        #     QMessageBox.information(self, "��Ϣ", "���c���˰��o 3")

        #�ڶ��N����
        match sender:
            case self.button1:
                QMessageBox.information(self, "��Ϣ", "���c���˰��o 1")
            case self.button2:
                QMessageBox.information(self, "��Ϣ", "���c���˰��o 2")
            case self.button3:
                QMessageBox.information(self, "��Ϣ", "���c���˰��o 3")

app = QApplication([])
window = MainWindow()
window.show()
app.exec()

Python��λ�C�_�l(f��)�̳�
��Ҫ�ԌW�W�̳� ��80 Ԫ
�M��ُ�I
�����uՓ
���ӱ���
�������A���񹲺͇��ĸ�헵��·�Ҏ(gu��)��
�Г��������О�����µķ���؟����
��վ�Йౣ����h���Р��h�uՓ��
���c���uՓ���������ѽ���x������
�����l����
V
�ػݳ�ֵ
“ϵ�ͷ�
APP���d
�ٷ�΢��
����픲�
���P���]
�����܌������n�̸��dȤ
Python��λ�C�_�l(f��)�̳�

��105С��(ji��)����8618�ˌW�^

����x��:
��X�k�� ƽ���OӋ �҃��OӋ �����OӋ �Cе�OӋ ���I(y��)�Ԅӻ� Ӱҕ�Ӯ� �����_�l(f��) �W��OӋ ��Ӌ�n�� �dȤ���L AIGC