
ПОМОГИТЕ ПОЖАЛУЙСТА РЕШИТЬ ЗАДАЧИ ДАМ 70 БАЛОВ 1. Створіть проект, у якому розташуйте у вікні два
написи Моя країна та Україна. Установіть заголовок вікна Україна. Після настання події Click - з першим написом колір фону першого напису повинен стати синім, другого напису -жовтим. Після настання події Click з другим написом колір символів першого напису повинен стати жовтим, другого напису синім шрифт символів в обох написах Arial, 14, напівжирний. Вигляд вікна про- екту наведено на малюнку 6.37. Збережіть проект у папці з іменем завдання 6.4.8, створеній у вашій папці.2.Створіть проект, у якому в результаті настання події Click для кекски її розміри стануть 40 - 30 пікселів ( ширина 30 символів, висота 3 символів) і текст на кнопці зміниться на назву вашого населеного пункту. Зберегти проект у папці з іменем Завдання 6.3.1, створеній у вашій папці. Зробити це у Python 

Ответы на вопрос

Ответ:
1 в картинке
2
from tkinter import *
def resize_and_change_text():
cake.config(width=30, height=3, text='Назва вашого населеного пункту')
root = Tk()
cake = Button(root, text='Кекска', font=('Arial', 14, 'bold'), command=resize_and_change_text)
cake.pack()
root.mainloop()




To solve the given tasks, you need to create two projects in Python using a graphical user interface (GUI) library like Tkinter. Here are the steps to complete each task:
Task 1: Create a project with two labels and change their background colors and font styles on click event
1. Import the necessary modules: ```python from tkinter import * ```
2. Create a window and set its title: ```python root = Tk() root.title("Україна") ```
3. Create two labels with the desired text: ```python label1 = Label(root, text="Моя країна", font=("Arial", 14, "bold")) label2 = Label(root, text="Україна", font=("Arial", 14, "bold")) ```
4. Place the labels in the window: ```python label1.pack() label2.pack() ```
5. Define the click event function to change the background colors of the labels: ```python def change_colors(event): label1.config(bg="blue") label2.config(bg="yellow") ```
6. Bind the click event to the labels:
```python
label1.bind("
7. Run the GUI event loop: ```python root.mainloop() ```
8. Save the project in a folder named "Завдання 6.4.8".
Task 2: Create a project with a button that changes its size and text on click event
1. Import the necessary modules: ```python from tkinter import * ```
2. Create a window: ```python root = Tk() ```
3. Define the click event function to change the button's size and text: ```python def change_button(event): button.config(width=30, height=3) button.config(text="Your City Name") ```
4. Create a button with the desired text and bind the click event to it:
```python
button = Button(root, text="Click Me")
button.bind("
5. Place the button in the window: ```python button.pack() ```
6. Run the GUI event loop: ```python root.mainloop() ```
7. Save the project in a folder named "Завдання 6.3.1".
Please note that the provided code snippets are just a starting point, and you may need to modify them based on your specific requirements. Make sure to save the projects in the respective folders mentioned in the tasks.
I hope this helps you solve the given tasks! Let me know if you have any further questions.


Похожие вопросы
Топ вопросов за вчера в категории Информатика
Последние заданные вопросы в категории Информатика
-
Математика
-
Литература
-
Алгебра
-
Русский язык
-
Геометрия
-
Английский язык
-
Химия
-
Физика
-
Биология
-
Другие предметы
-
История
-
Обществознание
-
Окружающий мир
-
География
-
Українська мова
-
Информатика
-
Українська література
-
Қазақ тiлi
-
Экономика
-
Музыка
-
Право
-
Беларуская мова
-
Французский язык
-
Немецкий язык
-
МХК
-
ОБЖ
-
Психология
-
Физкультура и спорт
-
Астрономия
-
Кыргыз тили
-
Оʻzbek tili