Posts

Showing posts with the label python
Image
Creating my First GUI Application using Python We will learn • Creating GUI Window in python: Tkinter • Using nested loops • Playing sound in python How this program works ( General Logic )–––– Problems Faced––– I wanted a GUI program, so I used Tkinter, but the timer variable(stime) was not updating causing no output in the GUI window. So, I used the update() function in Tkinter to update ‘stime’, every time I set the value to stime in the loop. Program: –––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––– from tkinter import * import time import playsound self = Tk() # setting the title for our window self.title("Excercise Timer") #configuring background colour for our window self.configure(bg="black") #creating a variable basically this is our timer label stime = StringVar() #setting the initial value of the variable stime.set("00") #function def func():     nsets = int(setsVar.get()) #getting values from the sets entry     wt ...
Image
 PLAYING WITH PYTHON Learning Outcomes: Defining functions Recursive function using Graphics Using if else statements and for loops Aim of the program Creating a program to represent Fibonacci sequence graphically (Fibonacci spiral) . #Febonacci sequence  The Fibonacci sequence, also known as Fibonacci numbers, is defined as the sequence of numbers in which each number in the sequence is equal to the sum of two numbers before it. The Fibonacci Sequence is given as: Fibonacci Sequence = 0, 1, 1, 2, 3, 5, 8, 13, 21, …. This is the graphical representation of Fibonacci sequence   If you sum the squares of any series of Fibonacci numbers, they will equal the last Fibonacci number used in the series times the next Fibonacci number.  This property results in the Fibonacci spiral, based on the following progression and properties of the Fibonacci series: 12 + 12 + 22 + 32 + 52 = 5 x 8 Let’s start simulating.. STEP-1 : writing the program ***Import turtle (graphics module in...