# Python Tkinter GUI based "LOVE CALCULATOR" # import tkinter from tkinter import * # import random module import random # Creating GUI window root = Tk() # Defining the container size, width=400, height=240 root.geometry('400x240') # Title of the container root.title('Love Calculator????') # Function to calculate love percentage # between the user ans partner def calculate_love(): # value will contain digits between 0-9 st = '0123456789' # result will be in double digits digit = 2 temp = "".join(random.sample(st, digit)) result.config(text=temp) # Heading on Top heading = Label(root, text='Love Calculator - How much is he/she into you') heading.pack() # Slot/input for the first name slot1 = Label(root, text="Enter Your Name:") slot1.pack() name1 = Entry(root, border=5) name1.pack() # Slot/input for the partner name slot2 = Label(root, text="Enter Your Partner Name:") slot2.pack() name2 = ...
5a1 import 'package:flutter/material.dart' ; class MyStatelessWidget extends StatelessWidget { @override Widget build ( BuildContext context) { return Scaffold ( appBar : AppBar ( title : Text ( 'Stateless Widget Example' ), ), body : Center ( child : Text ( 'Hello, Flutter!' , // In this example, MyStatelessWidget does not change after it is built. The text "Hello, Flutter!" is static. style : TextStyle (fontSize : 24 ), ), ), ); } } void main () { runApp ( MaterialApp ( home : MyStatelessWidget (), )); } 5a2 import 'package:flutter/material.dart' ; class MyStatefulWidget extends StatefulWidget { @ override _MyStatefulWidgetState createState...
n = int ( input ( " Enter a number up to generate fibonacci series: " )) a = 0 b = 1 while a < n : print ( a , end = " " ) c = a + b a = b #the value of a is updated to be equal to the value of b b = c #the value of b is updated to be equal to the value of c ''' teration 1: a = 0 b = 1 Since 0 < 20, the condition is true. Output: 0 Iteration 2: a = 1 b = 1 Since 1 < 20, the condition is true. Output: 1 Iteration 3: a = 1 b = 2 Since 1 < 20, the condition is true. Output: 1 Iteration 4: a = 2 b = 3 Since 2 < 20, the condition is true. Output: 2 Iteration 5: a = 3 b = 5 Since 3 < 20, the condition is true. Output: 3 Iteration 6: ...
Comments
Post a Comment