Run this code. What happens  code: # Importing the required libraries import tkinter as T def GetMarks():              c = T.Tk()         c.configure(bg='light cyan')         Input_fields = ["Semester 1 Marks ","Semester 2 Marks", "Final Marks"]         variables = []                   for i in range(len(Input_fields)):             variables.append(T.StringVar())              c.title("Average Marks Portal")                  T.Label(c,                 text="Average Marks",                 font=("Georgia", 20,'bold') ,                  height=3,                 width=31,                                 bg="cyan",                  fg="black").grid(row=0,columnspan=2)                  for i in range(len(Input_fields)):             T.Entry(c,textvariable=variables[i]).grid(row=i+2, column=1)              T.Label(c,                     text=Input_fields[i],                     height=2,                     width=20,                     font=("Cubano", 16) ,                      bg="light cyan",                      fg="black").grid(row=i+2)                          def Results():             L =[]             for i in range(len(Input_fields)-1):                 L.append(int(variables[i].get()))                    F = str(sum(L)/len(L))             variables[len(Input_fields)-1].set(F)                  Sumbit_Button = T.Button(c,                                  bg="light cyan",                                  font=("Cubano", 11) ,                                  width=18,                                   text ="Calculate Average Marks ", command=Results)         Sumbit_Button.grid(row=10, columnspan=2)              c.geometry('550x500')         c.resizable(0, 0)          c.mainloop()          GetMarks()

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Run this code. What happens 

code:

# Importing the required libraries
import tkinter as T

def GetMarks():
    
        c = T.Tk()
        c.configure(bg='light cyan')
        Input_fields = ["Semester 1 Marks ","Semester 2 Marks", "Final Marks"]
        variables = []
         
        for i in range(len(Input_fields)):
            variables.append(T.StringVar())
    
        c.title("Average Marks Portal")
        
        T.Label(c,
                text="Average Marks",
                font=("Georgia", 20,'bold') , 
                height=3,
                width=31,                
                bg="cyan", 
                fg="black").grid(row=0,columnspan=2)
        
        for i in range(len(Input_fields)):
            T.Entry(c,textvariable=variables[i]).grid(row=i+2, column=1) 
            T.Label(c,
                    text=Input_fields[i],
                    height=2,
                    width=20,
                    font=("Cubano", 16) , 
                    bg="light cyan", 
                    fg="black").grid(row=i+2)   
             

        def Results():
            L =[]
            for i in range(len(Input_fields)-1):
                L.append(int(variables[i].get()))       
            F = str(sum(L)/len(L))
            variables[len(Input_fields)-1].set(F)
        
        Sumbit_Button = T.Button(c,
                                 bg="light cyan",
                                 font=("Cubano", 11) ,
                                 width=18, 
                                 text ="Calculate Average Marks ", command=Results)
        Sumbit_Button.grid(row=10, columnspan=2)
    
        c.geometry('550x500')
        c.resizable(0, 0) 
        c.mainloop()
        
GetMarks()

Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Arrays
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education