TGViewer
پایتون | Data Science | Machine Learning پایتون | Data Science | Machine Learning @python4all_pro · 24.2K subscribers
Post #135 5.74K
Build a Love Calculator Using Pytho


from tkinter import *

import random

root = Tk()

# Defining the size, width=400, height=240

root.geometry('400x240')

# Title

root.title('Love Calculator❤️❤️')

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????')

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 Curse Name:")

slot2.pack()

name2 = Entry(root, border=5)

name2.pack()

bt = Button(root, text="Calculate", height=1,

width=7, command=calculate_love)

bt.pack()

# Text on result slot

result = Label(root, text='Love Percentage between both of You:')

result.pack()

# Starting the GUI

root.mainloop()



#code

🆔 @Python4all_pro
  • 👍 2
  • 🤷‍♂ 1
More from @python4all_pro
  1. Oct 6, 2026#ایونت_آنلاین مجازی‌سازی؛ قلب پنهان زیرساخت👀 اگه به شبکه، سرور و زیرساخت علاقه داری، احتم…
  2. Oct 6, 2026🔴🔴ماهی 3 پروژه 20 میلیونی این شغل 60 میلیون بهت درآمد میده ۳۰ نفری که در تیم ما استخدام…
  3. Oct 4, 2026‌🔴 خبر فوری — انتخاب رشته هوشمند و رایگان با «مسیر» 🔥 «مسیر» نرم‌افزار هوشمند و کاملاً ر…
  4. Sep 29, 2026What better way to understand a powerful tool like Claude Code than to build your own vers…
  5. Sep 28, 202625 GitHub Repositories Every Python Developer Should Know! Want to improve your Python ski…
  6. Sep 27, 202640+ FREE Python Books from Amazon! Want to improve your Python skills without spending a f…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →