Python Forum
Not Getting The desired output on my system
Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Not Getting The desired output on my system
#5
The instructions I gave you are valid.
Lat me have a look'

try:
from tkinter import *
import random
 
class ExamGuru:
    def _init_(self, parent, title='None', geometry='100x100+10+10'):
        self.parent=parent
        self.parent.geometry(geometry)
        self.title(title)
        self.index=0
        self.question_num=1
        self.score=0
        self.questions=[Question("First Insurance Company In India ? ", "Oreintal Life Insurance",["Bombay Mutual Insurance","Western India Insurance","LIC"]),
                        Question("Which Of The Following Risks Are Insurable ?", "Financial Risk",["Non Financial","Both","None"])]
 
        self.mainquestionframe= Frame(parent, bg="orange", width=800, height=500)
        self.mainquestionframe.pack_propagate(0)
        self.mainquestionframe.pack(pady=5)
 
        self.headingframe= Frame(self.mainquestionframe, bg="blue",Width=800, height=40)
        self.headingframe.pack_propagate()
        self.headingframe.pack(pady=5)
 
 
class Question:
    def _init_(self,question,answer,dummies):
        self.question=question
        self.answer=answer
        self.dummies=dummies
        self.set_answers()
 
    def set_answers(self):
        self.answers=self.dummies
        self.answer.insert(random.randrange(len(self.dummies)+1), self.answer)
 
 
if __name__=='__main__':
    root=Tk()
    ExamGuru(parent=root, title="Exam Guru", geometry='600x400+10+10')
    root.mainloop()
Reply


Messages In This Thread
RE: Not Getting The desired output on my system - by Larz60+ - Apr-03-2017, 06:35 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Json filter is not capturing desired key/element mrapple2020 1 1,263 Nov-24-2022, 09:22 AM
Last Post: ibreeden
  how can I display only desired items? 3lnyn0 5 2,240 Dec-25-2021, 06:49 PM
Last Post: menator01
  ERROR: importing desired module mbgamer28 0 1,752 Apr-05-2021, 07:46 PM
Last Post: mbgamer28
  Not rounding to desired decimal places? pprod 2 2,673 Mar-05-2021, 11:11 AM
Last Post: pprod
  Difference between os.system("clear") and os.system("cls") chmsrohit 7 16,988 Jan-11-2021, 06:30 PM
Last Post: ykumar34
  Why this code not getting desired output ? MDRI 2 2,674 Sep-18-2020, 02:11 AM
Last Post: MDRI
  showing only desired part of a plot grknkilicaslan 1 2,463 Jul-10-2020, 03:51 PM
Last Post: Marbelous
  [Beginner] Code is not producing desired result fakej171 2 2,557 Mar-21-2020, 10:26 AM
Last Post: buran
  Not Getting the Desired value using json.dumps saurabh210 0 1,585 Feb-03-2020, 06:48 PM
Last Post: saurabh210
Question Difference between Python's os.system and Perl's system command Agile741 13 7,179 Dec-02-2019, 04:41 PM
Last Post: Agile741

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020