Kw3
Kw3
  • 46
  • 187
VMOS, android virtual machine
VMOS, android virtual machine. Mendapatkan android diroot dengan virtual machine tanpa ribet buat root android aslinya. Lebih leluasa buat belajar oprek di android VM
Переглядів: 44

Відео

Belajar bahasa Inggris dengan Elsa Speak
Переглядів 1114 днів тому
Belajar bahasa Inggris dengan Elsa Speak
Belajar edit video dengan CapCut
Переглядів 621 день тому
Belajar edit video dengan CapCut
Memperpanjang masa pakai tombol power dengan aplikasi Shutdown
Переглядів 121 день тому
Memperpanjang masa pakai tombol power dengan aplikasi Shutdown
Aplikasi operasi matrix dengan python
Переглядів 428 днів тому
Aplikasi operasi matrix dengan python
Review aplikasi Peta Bumi Langsung
Переглядів 12Місяць тому
Review aplikasi Peta Bumi Langsung. Download gratis si playstore sudah mwndapatkan fitur yang lengkap
Membuat kinerja android lebih cepat
Переглядів 18Місяць тому
Membuat kinerja android lebih cepat
Mengakses database Mysql di cloud dengan Patron DB
Переглядів 2Місяць тому
Mengakses database Mysql di cloud dengan Patron DB
Membuat database di server/ cloud secara gratis
Переглядів 4Місяць тому
Membuat database di server/ cloud secara gratis di www.freemysqlhosting.net
Belajar python intermediate dengan aplikasi Sololearn
Місяць тому
Belajar python intermediate dengan aplikasi Sololearn
Tetris game dengan python
Переглядів 5Місяць тому
Tetris game dengan python
Belajar python advance dengan Programming Hub
Місяць тому
Belajar python advance dengan Programming Hub
Identifikasi tanaman dengan aplikasi google lens
Переглядів 1Місяць тому
Identifikasi tanaman dengan aplikasi google lens
Aplikasi keuangan dengan python
Переглядів 2Місяць тому
Aplikasi keuangan dengan python
Game Minesweeper dengan aplikasi python
Місяць тому
Game Minesweeper dengan aplikasi python
Menghitung persamaan linear dua variabel dengan python
Місяць тому
Menghitung persamaan linear dua variabel dengan python
Belajar bahasa Inggris dengan Faloe
Переглядів 1Місяць тому
Belajar bahasa Inggris dengan Faloe
Netbook jadoel Toshiba NB-250
Переглядів 14Місяць тому
Netbook jadoel Toshiba NB-250
Belajar Kotlin dengan Programming Hub
Місяць тому
Belajar Kotlin dengan Programming Hub
Review aplikasi WPS Office
Переглядів 3Місяць тому
Review aplikasi WPS Office
Konversi satuan panjang dengan python
Місяць тому
Konversi satuan panjang dengan python
Belajar bahasa Arab dengan FunEasyLearn
Переглядів 1Місяць тому
Belajar bahasa Arab dengan FunEasyLearn
Aplikasi konversi temperatur dengan python
Переглядів 1Місяць тому
Aplikasi konversi temperatur dengan python
Unboxing Kemei Clipper KM-PG809A
Переглядів 4Місяць тому
Unboxing Kemei Clipper KM-PG809A
Unboxing Kemei Clipper KM-PG809A
Переглядів 2Місяць тому
Unboxing Kemei Clipper KM-PG809A
Belajar bahasa Arab dengan busuu
Переглядів 2Місяць тому
Belajar bahasa Arab dengan busuu
Aplikasi text editor dengan python
Переглядів 2Місяць тому
Aplikasi text editor dengan python
Violoncello, aplikasi browser super hemat data yang hanya menampilkan teks
Переглядів 2Місяць тому
Violoncello, aplikasi browser super hemat data yang hanya menampilkan teks
Aplikasi database dengan python
Переглядів 1Місяць тому
Aplikasi database dengan python
Aplikasi waktu shalat dengan python
Переглядів 6Місяць тому
Aplikasi waktu shalat dengan python

КОМЕНТАРІ

  • @alissonramos5961
    @alissonramos5961 9 днів тому

    Link

  • @oowo6177
    @oowo6177 9 днів тому

    Mantep

  • @AbdulAziz-t5s
    @AbdulAziz-t5s 29 днів тому

    www.dropbox.com/scl/fi/65dgqataa5x7umoxvu5p9/mc4.py?rlkey=hprnwywiksyve8xlto54i9sjq&st=t9zm3dtm&dl=0

  • @AbdulAziz-t5s
    @AbdulAziz-t5s Місяць тому

    www.dropbox.com/scl/fi/cbglja65nqliw0266p5b6/Patron-DB_2.3.0.rar?rlkey=3f44a3vpvlwiwq2eowugrx09e&st=lyvtgmqj&dl=0

  • @AbdulAziz-t5s
    @AbdulAziz-t5s Місяць тому

    www.dropbox.com/scl/fi/wrm05pmamqj4rms8ux986/tetris15.py?rlkey=ruh0venks2473c2z9ups9mzbo&st=etb5zrg0&dl=0

  • @AbdulAziz-t5s
    @AbdulAziz-t5s Місяць тому

    import math from datetime import datetime import tkinter as tk from tkinter import messagebox def format_amount(amount): return "{:,.2f}".format(amount) def read_amount(): try: with open("amount.txt", "r") as file: amount = float(file.read().strip()) except (FileNotFoundError, ValueError): amount = 0.0 return amount def write_amount(amount): with open("amount.txt", "w") as file: file.write(str(amount)) def write_history(add_amount, remark, current_amount): current_time = datetime.now().strftime("%Y-%m-%d %H:%M:%S") new_entry = f"[{current_time}] Added: {format_amount(add_amount)}, Remark: {remark}, Balance: {format_amount(current_amount)} " try: with open("history.txt", "r") as file: existing_content = file.read() except FileNotFoundError: existing_content = "" with open("history.txt", "w") as file: file.write(new_entry + existing_content) def display_history(): try: with open("history.txt", "r") as file: return file.read() except FileNotFoundError: return "No transaction history found." def add_balance(): try: add_amount = float(amount_entry.get()) remark = remark_entry.get() global current_amount current_amount += add_amount write_amount(current_amount) write_history(add_amount, remark, current_amount) messagebox.showinfo("Transaction Successful", f"Added {format_amount(add_amount)}. New balance: {format_amount(current_amount)} Remark: {remark}") # Clear the input fields amount_entry.delete(0, tk.END) remark_entry.delete(0, tk.END) # Update the current amount label update_current_amount_label() # Show updated history show_history() except ValueError: messagebox.showerror("Invalid Input", "Please enter a valid number for the amount.") def update_current_amount_label(): current_amount_label.config(text=f"Current amount: {format_amount(current_amount)}") def show_history(): history = display_history() history_text.delete(1.0, tk.END) history_text.insert(tk.END, history) def refresh_app(): # Clear the input fields amount_entry.delete(0, tk.END) remark_entry.delete(0, tk.END) # Clear the history text area history_text.delete(1.0, tk.END) # Update the current amount label update_current_amount_label() # Initialize the main window root = tk.Tk() root.title("Balance Manager") root.geometry("400x500") # Font settings font_style = ("Arial", 12) font_button_style = ("Arial", 10) # for button history_font_style = ("Arial", 9) # Different font size for the history display # Current amount current_amount = read_amount() # Widgets current_amount_label = tk.Label(root, text=f"Current amount: {format_amount(current_amount)}", font=font_style) current_amount_label.pack(pady=10) amount_label = tk.Label(root, text="Enter amount to add:", font=font_style) amount_label.pack() amount_entry = tk.Entry(root, font=font_style) amount_entry.pack(pady=5) remark_label = tk.Label(root, text="Enter a remark:", font=font_style) remark_label.pack() remark_entry = tk.Entry(root, font=font_style) remark_entry.pack(pady=5) add_button = tk.Button(root, text="Add Balance", command=add_balance, font=font_button_style) add_button.pack(pady=10) show_history_button = tk.Button(root, text="Show History", command=show_history, font=font_button_style) show_history_button.pack(pady=10) refresh_button = tk.Button(root, text="Refresh", command=refresh_app, font=font_button_style) refresh_button.pack(pady=10) exit_button = tk.Button(root, text="Exit", command=root.quit, font=font_button_style) exit_button.pack(pady=10) history_text = tk.Text(root, height=10, width=40, font=history_font_style) # Apply the smaller font size here history_text.pack(pady=10) # Run the application root.mainloop()

  • @AbdulAziz-t5s
    @AbdulAziz-t5s Місяць тому

    import tkinter as tk import random x = 25 #amount of mine class Minesweeper: def __init__(self, width, height, num_mines): self.width = width self.height = height self.num_mines = num_mines self.board = [[0 for _ in range(width)] for _ in range(height)] self.revealed = [[False for _ in range(width)] for _ in range(height)] self.first_click = True self.root = tk.Tk() self.root.title("Minesweeper") # Title label self.title_label = tk.Label(self.root, text=f"Minesweeper{x}", font=('Helvetica', 14), fg="black") self.title_label.pack(pady=10) self.frame = tk.Frame(self.root) self.frame.pack() self.buttons = [] for i in range(height): row = [] for j in range(width): button = tk.Button(self.frame, width=2, height=1, padx=10, pady=10, command=lambda i=i, j=j: self.click(i, j)) button.grid(row=i, column=j) row.append(button) self.buttons.append(row) # Add the reset button self.reset_button = tk.Button(self.root, text="Reset", command=self.new_game) self.reset_button.pack(pady=10) self.reset_button.pack_forget() # Initially hide the reset button # Add the mines remaining label self.mines_label = tk.Label(self.root, text=f"{self.num_mines}", font=('Helvetica', 10), fg="purple") self.mines_label.pack(side=tk.RIGHT, padx=10, pady=10) self.new_game() def new_game(self): self.first_click = True self.title_label.config(text="Minesweeper", font=('Helvetica', 14), fg="black") self.mines_label.config(text=f"Mines: {self.num_mines}") self.mines_label.pack(side=tk.RIGHT, padx=10, pady=10) # Show the mines label for i in range(self.height): for j in range(self.width): self.board[i][j] = 0 self.revealed[i][j] = False self.buttons[i][j].config(text="", bg="lightgray", state=tk.NORMAL) mines_placed = 0 while mines_placed < self.num_mines: x, y = random.randint(0, self.width - 1), random.randint(0, self.height - 1) if self.board[y][x] != -1: self.board[y][x] = -1 mines_placed += 1 for i in range(self.height): for j in range(self.width): if self.board[i][j] != -1: count = 0 for x in range(max(0, i - 1), min(self.height, i + 2)): for y in range(max(0, j - 1), min(self.width, j + 2)): if self.board[x][y] == -1: count += 1 self.board[i][j] = count self.reset_button.pack_forget() # Hide the reset button when starting a new game def click(self, i, j): if self.first_click: self.first_click = False if self.board[i][j] == -1: while self.board[i][j] == -1: self.new_game() self.reveal(i, j) else: if self.board[i][j] == -1: self.game_over() else: self.reveal(i, j) def reveal(self, i, j): if self.revealed[i][j]: return self.revealed[i][j] = True if self.board[i][j] > 0: self.buttons[i][j].config(text=str(self.board[i][j]), bg="gray") else: self.buttons[i][j].config(text="", bg="gray") for x in range(max(0, i - 1), min(self.height, i + 2)): for y in range(max(0, j - 1), min(self.width, j + 2)): if not self.revealed[x][y]: self.reveal(x, y) self.check_win() def check_win(self): for i in range(self.height): for j in range(self.width): if self.board[i][j] != -1 and not self.revealed[i][j]: return self.win() def win(self): for i in range(self.height): for j in range(self.width): if self.board[i][j] == -1: self.buttons[i][j].config(text="X", bg="green") self.buttons[i][j].config(state=tk.DISABLED) # Disable buttons after winning self.title_label.config(text="You Win!", font=('Helvetica', 14), fg="blue") self.reset_button.pack(pady=10) # Show the reset button when the player wins self.mines_label.pack_forget() # Hide the mines label when the player wins def game_over(self): for i in range(self.height): for j in range(self.width): if self.board[i][j] == -1: self.buttons[i][j].config(text="X", bg="red") else: self.buttons[i][j].config(text=str(self.board[i][j]), bg="gray") self.buttons[i][j].config(state=tk.DISABLED) # Disable buttons after game over self.title_label.config(text="You Lost!", font=('Helvetica', 14), fg="red") self.reset_button.pack(pady=10) # Show the reset button when the game is over self.mines_label.pack_forget() # Hide the mines label when the game is over def run(self): self.root.mainloop() if __name__ == "__main__": game = Minesweeper(10, 20, x) game.run()

  • @AbdulAziz-t5s
    @AbdulAziz-t5s Місяць тому

    import math def solve_linear_equations(a1, b1, c1, a2, b2, c2): """ Solves a system of two linear equations: a1*x + b1*y = c1 a2*x + b2*y = c2 Returns a tuple (x, y) or None if the system has no unique solution. """ # Calculate the determinant det = a1 * b2 - a2 * b1 if det == 0: print("The system has no unique solution (lines are parallel or coincident).") return None # Calculate x and y using Cramer's rule x = (c1 * b2 - c2 * b1) / det y = (a1 * c2 - a2 * c1) / det return (x, y) def main(): # Get user input for the coefficients print("Enter the coefficients for the first equation (a1*x + b1*y = c1):") a1 = float(input("a1: ")) b1 = float(input("b1: ")) c1 = float(input("c1: ")) print(" Enter the coefficients for the second equation (a2*x + b2*y = c2):") a2 = float(input("a2: ")) b2 = float(input("b2: ")) c2 = float(input("c2: ")) # Solve the system of equations result = solve_linear_equations(a1, b1, c1, a2, b2, c2) if result: x, y = result print(f" Solution: x = {x}, y = {y}") print(" ") print(f"Checking the solution:") print(f"{a1}*{x} + {b1}*{y} = {a1*x + b1*y}") print(f"{a2}*{x} + {b2}*{y} = {a2*x + b2*y}") # Write results to xy.txt with open("xy.txt", "a") as file: file.write(f"Equations: ") file.write(f"{a1}x + {b1}y = {c1} ") file.write(f"{a2}x + {b2}y = {c2} ") file.write(f"Solution: x = {x} y = {y} ") file.write(f"Verification: ") file.write(f"{a1}*{x} + {b1}*{y} = {a1*x + b1*y} ") file.write(f"{a2}*{x} + {b2}*{y} = {a2*x + b2*y} ") file.write("=" * 30 + " ") # Main program loop while True: main() # Call the main function to solve equations choice = input(" Calculate again? Press Enter to continue or 'q' to quit: ") if choice.lower() == 'q': print("Results have been saved to xy.txt") break else: print(" ")

  • @AbdulAziz-t5s
    @AbdulAziz-t5s Місяць тому

    def km_to_mile(km): """Convert kilometer to mile""" mile = km * 0.621371 return mile def mile_to_inch(mile): """Convert mile to inch""" inch = mile * 63360 return inch def inch_to_mile(inch): """Convert inch to mile""" mile = inch / 63360 return mile def km_to_nmile(km): """Convert kilometer to nautical mile""" nmile = km * 0.539957 return nmile def km_to_feet(km): """Convert kilometer to feet""" feet = km * 3280.84 return feet def mile_to_km(mile): """Convert mile to km""" km = mile / 0.621371 return km def nmile_to_km(nmile): """Convert nautical mile to km""" km = nmile / 0.539957 return km def feet_to_km(feet): """Convert feet to kilometer""" km = feet / 3280.84 return km # Main converter function def main(): print("Distance Converter") while True: print(" 1. Kilometer") print("2. Mile") print("3. Nautical Mile") print("4. Feet") print("5. Inch") print("") choice = input("Choose what to convert or 'q' to quit: ") if choice.lower() == 'q': print("Goodbye!") break try: if choice == '1': print(" ") km = float(input("Enter in Kilometer(s): ")) mile = km_to_mile(km) nmile = km_to_nmile(km) feet = km_to_feet(km) inch = mile_to_inch(mile) print(f" {km} Km(s)") print(f"{mile:.6f} mile(s)") print(f"{nmile:.6f} nautical mile(s)") print(f"{feet:.2f} feet") print(f"{inch:.6f} inch(es)") elif choice == '2': print(" ") mile = float(input("Enter in mile(s): ")) km = mile_to_km(mile) nmile = km_to_nmile(km) feet = km_to_feet(km) inch = mile_to_inch(mile) print(f" {mile:.6f} mile(s)") print(f"{nmile:.6f} nautical mile(s)") print(f"{km:.6f} Km(s)") print(f"{feet:.2f} feet") print(f"{inch} inch(es)") elif choice == '3': print("") nmile = float(input("Enter in nautical mile(s): ")) km = nmile_to_km(nmile) mile = km_to_mile(km) feet = km_to_feet(km) inch = mile_to_inch(mile) print(f" {nmile} nautical mile(s)") print(f"{mile:.6f} mile(s)") print(f"{km:.6f} Km(s)") print(f"{feet:.2f} feet") print(f"{inch:.6f} inch(es)") elif choice == '4': print("") feet = float(input("Enter in feet: ")) km = feet_to_km(feet) mile = km_to_mile(km) nmile = km_to_nmile(km) inch = mile_to_inch(mile) print(f" {feet:.2f} feet") print(f"{km:.6f} Km(s)") print(f"{mile:.6f} mile(s)") print(f"{nmile:.6f} nautical mile(s)") print(f"{inch:.6f} inch(es)") elif choice == '5': print("") inch = float(input("Enter in inch(es): ")) mile = inch_to_mile(inch) km = mile_to_km(mile) nmile = km_to_nmile(km) feet = km_to_feet(km) print(f" {inch:.2f} inch(es)") print(f"{mile:.6f} mile(s)") print(f"{nmile:.6f} nautical mile(s)") print(f"{km:.6f} Km(s)") print(f"{feet:.2f} feet") else: print("Invalid choice. Please try again.") except ValueError: print("Invalid input. Please enter a numerical value.") input(" Press Enter to continue...") # Run the converter main()

  • @AbdulAziz-t5s
    @AbdulAziz-t5s Місяць тому

    def celsius_to_reamur(celsius): """Convert Celsius to Réaumur""" reamur = celsius * 4 / 5 return reamur def celsius_to_fahrenheit(celsius): """Convert Celsius to Fahrenheit""" fahrenheit = celsius * 9 / 5 + 32 return fahrenheit def celsius_to_kelvin(celsius): """Convert Celsius to Kelvin""" kelvin = celsius + 273.15 return kelvin def reamur_to_celsius(reamur): """Convert Reamur to Celsius""" celsius = reamur * 5 / 4 return celsius def fahrenheit_to_celsius(fahrenheit): """Convert Fahrenheit to Celsius""" celsius = (fahrenheit - 32) * 5 / 9 return celsius def kelvin_to_celsius(kelvin): """Convert Kelvin to Celsius""" celsius = kelvin - 273.15 return celsius # Main converter function def main(): print("Temperature Converter") while True: print(" 1. Celsius") print("2. Réaumur") print("3. Fahrenheit") print("4. Kelvin") print("") choice = input("Choose what to convert or 'q' to quit: ") if choice == 'q': print("Goodbye!") break try: if choice == '1': print(" ") celsius = float(input("Enter temperature in Celsius: ")) reamur = celsius_to_reamur(celsius) fahrenheit = celsius_to_fahrenheit(celsius) kelvin = celsius_to_kelvin(celsius) print(f" {celsius} °C") print(f"{reamur:.2f} °Ré") print(f"{fahrenheit:.2f} °F") print(f"{kelvin:.2f} K") elif choice == '2': print(" ") reamur = float(input("Enter temperature in Réaumur: ")) celsius = reamur_to_celsius(reamur) fahrenheit = celsius_to_fahrenheit(celsius) kelvin = celsius_to_kelvin(celsius) print(f" {reamur} °Ré") print(f"{celsius:.2f} °C") print(f"{fahrenheit:.2f} °F") print(f"{kelvin:.2f} K") elif choice == '3': print("") fahrenheit = float(input("Enter temperature in Fahrenheit: ")) celsius = fahrenheit_to_celsius(fahrenheit) reamur = celsius_to_reamur(celsius) kelvin = celsius_to_kelvin(celsius) print(f" {fahrenheit} °F") print(f"{celsius:.2f} °C") print(f"{reamur:.2f} °Ré") print(f"{kelvin:.2f} K") elif choice == '4': print("") kelvin = float(input("Enter temperature in Kelvin: ")) celsius = kelvin_to_celsius(kelvin) reamur = celsius_to_reamur(celsius) fahrenheit = celsius_to_fahrenheit(celsius) print(f" {kelvin} K") print(f"{celsius:.2f} °C") print(f"{reamur:.2f} °Ré") print(f"{fahrenheit:.2f} °F") else: print("Invalid choice. Please try again.") except ValueError: print("Invalid input. Please enter a numerical value.") input(" Press any key to continue...") # Run the converter main()

  • @AbdulAziz-t5s
    @AbdulAziz-t5s Місяць тому

    www.dropbox.com/scl/fi/797cp3rf55zyu497dieeq/te.rar?rlkey=d2pbsb6w0bs3wzvmpshg9k6vm&dl=0

  • @AbdulAziz-t5s
    @AbdulAziz-t5s Місяць тому

    Source code: www.dropbox.com/scl/fi/2we5hrcdxdrjrtjuckytz/running_text.rar?rlkey=dfixh93s86saq7wm2puq0t079&e=2&dl=0

  • @AbdulAziz-t5s
    @AbdulAziz-t5s 2 місяці тому

    import math from datetime import datetime def format_amount(amount): return "{:,.2f}".format(amount) def read_amount(): try: with open("amount.txt", "r") as file: amount = float(file.read().strip()) except FileNotFoundError: print("File 'amount.txt' not found. Starting with 0.") amount = 0.0 except ValueError: print("Invalid amount in file. Starting with 0.") amount = 0.0 return amount def write_amount(amount): with open("amount.txt", "w") as file: file.write(str(amount)) def write_history(add_amount, remark, current_amount): current_time = datetime.now().strftime("%Y-%m-%d %H:%M:%S") with open("history.txt", "a") as file: file.write(f"[{current_time}] Amount Added: {format_amount(add_amount)}, Remark: {remark}, Updated Balance: {format_amount(current_amount)} ") def display_history(): try: with open("history.txt", "r") as file: print(file.read()) except FileNotFoundError: print("No transaction history found.") def main(): current_amount = read_amount() print(f"Current amount: {format_amount(current_amount)}") while True: print(" Options:") print("a - Add balance") print("h - Display transaction history") print("x - Exit ") option = input("Choose an option: ").lower() if option == 'a': try: add_amount = float(input("Enter amount to add: ")) remark = input("Enter a remark for this transaction: ") current_amount += add_amount print(f" Added {format_amount(add_amount)}. New balance: {format_amount(current_amount)}") print(f"Remark: {remark}") write_amount(current_amount) write_history(add_amount, remark, current_amount) except ValueError: print("Invalid input. Please enter a number.") elif option == 'h': display_history() elif option == 'x': break else: print("Invalid option. Please choose a valid option.") print(f" Final balance: {format_amount(current_amount)}") print("Amount updated in 'amount.txt'.") print("Transaction history with timestamps saved in 'history.txt'.") if __name__ == "__main__": main()

  • @AbdulAziz-t5s
    @AbdulAziz-t5s 2 місяці тому

    import tkinter as tk from threading import Thread, Event import time import random class SlotMachine: def __init__(self, root): self.root = root self.root.title("Slot Machine") self.symbols = [1, 2, 3, 4, 5, 6, 7, 8, 9] self.reels = [] self.stop_events = [] self.threads = [] self.current_reel = 0 # To keep track of which reel to stop next self.balance = 100 self.balance_label = tk.Label(root, text=f"Balance: ${self.balance}", font=('Helvetica', 12)) self.balance_label.pack() self.reel_frames = [ tk.Label(root, text="Reel 1", font=('Helvetica', 24)), tk.Label(root, text="Reel 2", font=('Helvetica', 24)), tk.Label(root, text="Reel 3", font=('Helvetica', 24)) ] for reel_frame in self.reel_frames: reel_frame.pack() self.spin_button = tk.Button(root, text="Spin", font=('Helvetica', 24),fg="green", command=self.spin) self.spin_button.pack() self.stop_button = tk.Button(root, text="Stop Reel", font=('Helvetica', 24),fg="red",command=self.stop_next_reel, state=tk.DISABLED) self.stop_button.pack() self.result_label = tk.Label(root, text="", font=('Helvetica', 18)) self.result_label.pack(side=tk.BOTTOM) def display_reel(self, i, stop_event): symbol_index = 0 while not stop_event.is_set(): current_symbol = self.symbols[symbol_index] self.reel_frames[i].config(text=current_symbol) symbol_index = (symbol_index + 1) % len(self.symbols) timesleep = random.choice([0.1, 0.15, 0.2, 0.25, 0.3, 0.4, 0.5]) time.sleep(timesleep) def spin(self): if self.balance < 10: self.result_label.config(text="Not enough balance to play!") return self.balance -= 10 self.balance_label.config(text=f"Balance: ${self.balance}") self.result_label.config(text="") # Start spinning threads self.stop_events = [Event() for _ in range(3)] self.threads = [] self.current_reel = 0 # Reset to the first reel for i in range(3): thread = Thread(target=self.display_reel, args=(i, self.stop_events[i])) self.threads.append(thread) thread.start() self.spin_button.config(state=tk.DISABLED) self.stop_button.config(state=tk.NORMAL) def stop_next_reel(self): if self.current_reel < 3: self.stop_events[self.current_reel].set() self.threads[self.current_reel].join() self.current_reel += 1 if self.current_reel == 3: self.stop_button.config(state=tk.DISABLED) self.spin_button.config(state=tk.NORMAL) result = [self.reel_frames[i].cget("text") for i in range(3)] self.check_win(result) def check_win(self, result): if result[0] == result[1] == result[2]: self.result_label.config(text="Congratulations! You won!", font=('Helvetica', 16),fg="green") self.balance += 60 elif result[0] == result[1] or result[1] == result[2] or result[0] == result[2]: self.result_label.config(text="Draw!", font=('Helvetica', 16),fg="blue") self.balance += 10 else: self.result_label.config(text="Sorry, you lost. Try again!", font=('Helvetica', 16),fg="red") self.balance_label.config(text=f"Balance: ${self.balance}") # Check if balance is >= 500 if self.balance >= 500: self.result_label.config(text="Game over. You are richer now!", font=('Helvetica', 18),fg="gold") self.spin_button.config(state=tk.DISABLED) self.stop_button.config(state=tk.DISABLED) def main(): root = tk.Tk() app = SlotMachine(root) root.mainloop() if __name__ == "__main__": main()

  • @AbdulAziz-t5s
    @AbdulAziz-t5s 2 місяці тому

    import statistics # Function to calculate basic statistics def calculate_statistics(data): if not data: return "Error: Empty dataset" # Calculate mean (average) mean = statistics.mean(data) # Calculate median (middle value) median = statistics.median(data) # Calculate mode (most frequent value) try: mode = statistics.mode(data) except statistics.StatisticsError: mode = "No unique mode" # Calculate standard deviation std_dev = statistics.stdev(data) # Calculate range data_range = max(data) - min(data) # Calculate minimum and maximum minimum = min(data) maximum = max(data) # Return results return { "Mean": mean, "Median": median, "Mode": mode, "Standard Deviation": std_dev, "Range": data_range, "Minimum": minimum, "Maximum": maximum } # Function to get user input def get_user_input(): data = [] print("Enter numbers one by one. Press Enter without a number to finish.") while True: user_input = input("Enter a number (or press Enter to finish): ") if user_input == "": break try: number = float(user_input) data.append(number) except ValueError: print("Invalid input. Please enter a valid number.") return data # Function to save results to a file def save_results_to_file(data, results, filename): with open(filename, 'w') as file: file.write("Dataset: " + str(data) + " ") for stat, value in results.items(): file.write(f"{stat}: {value} ") print(f"Results have been saved to {filename}") # Main program user_data = get_user_input() results = calculate_statistics(user_data) print(" Dataset:", user_data) print("") for stat, value in results.items(): print(f"{stat}: {value}") print("") save_results_to_file(user_data, results, "stat.txt")

  • @AbdulAziz-t5s
    @AbdulAziz-t5s 2 місяці тому

    import math # 1. Cube def cube_area(side): return 6 * side**2 def cube_volume(side): return side**3 # 2. Cuboid def cuboid_area(length, width, height): return 2 * (length * width + width * height + height * length) def cuboid_volume(length, width, height): return length * width * height # 3. Cylinder def cylinder_area(radius, height): return 2 * math.pi * radius * (radius + height) def cylinder_volume(radius, height): return math.pi * radius**2 * height # 4. Sphere def sphere_area(radius): return 4 * math.pi * radius**2 def sphere_volume(radius): return (4/3) * math.pi * radius**3 # 5. Triangular Prism def triangular_prism_area(base, height, length): base_area = 0.5 * base * height side_area1 = length * base side_area2 = length * height hypotenuse = math.sqrt(base**2 + height**2) side_area3 = length * hypotenuse return 2 * base_area + side_area1 + side_area2 + side_area3 def triangular_prism_volume(base, height, length): return 0.5 * base * height * length # 6. Triangular Pyramid def triangular_pyramid_area(base, height, slant_height): base_area = 0.5 * base * height lateral_area = 3 * (0.5 * base * slant_height) return base_area + lateral_area def triangular_pyramid_volume(base, height, pyramid_height): return (1/3) * 0.5 * base * height * pyramid_height # 7. Rectangular Pyramid def rectangular_pyramid_area(length, width, slant_height): base_area = length * width lateral_area = length * slant_height + width * slant_height return base_area + lateral_area def rectangular_pyramid_volume(length, width, height): return (1/3) * length * width * height # 8. Cone def cone_area(radius, slant_height): return math.pi * radius * (radius + slant_height) def cone_volume(radius, height): return (1/3) * math.pi * radius**2 * height # Main function to interact with the user def main(): while True: print(" Calculate area and volume of:") print("") print("1. Cube 5. Triangular Prism") print("2. Cuboid 6. Triangular Pyramid") print("3. Cylinder 7. Rectangular Pyramid") print("4. Sphere 8. Cone") print("") choice = input("Choose an operation or 'q' to quit: ") if choice == '1': print("") side = float(input("Enter the side of the cube: ")) print("") print(f"Cube area: {cube_area(side)}") print(f"Cube volume: {cube_volume(side)}") anykey = input() elif choice == '2': print("") length = float(input("Enter the length of the cuboid: ")) width = float(input("Enter the width of the cuboid: ")) height = float(input("Enter the height of the cuboid: ")) print("") print(f"Cuboid area: {cuboid_area(length, width, height)}") print(f"Cuboid volume: {cuboid_volume(length, width, height)}") anykey = input() elif choice == '3': print("") radius = float(input("Enter the radius of the cylinder: ")) height = float(input("Enter the height of the cylinder: ")) print("") print(f"Cylinder area: {cylinder_area(radius, height)}") print(f"Cylinder volume: {cylinder_volume(radius, height)}") anykey = input() elif choice == '4': print("") radius = float(input("Enter the radius of the sphere: ")) print("") print(f"Sphere area: {sphere_area(radius)}") print(f"Sphere volume: {sphere_volume(radius)}") anykey = input() elif choice == '5': print("") base = float(input("Enter the base of the triangular prism: ")) height = float(input("Enter the height of the triangular prism: ")) length = float(input("Enter the length of the triangular prism: ")) print("") print(f"Triangular Prism area: {triangular_prism_area(base, height, length)}") print(f"Triangular Prism volume: {triangular_prism_volume(base, height, length)}") anykey = input() elif choice == '6': print("") base = float(input("Enter the base of the triangular pyramid: ")) height = float(input("Enter the height of the triangular pyramid: ")) slant_height = float(input("Enter the slant height of the triangular pyramid: ")) pyramid_height = float(input("Enter the height of the pyramid: ")) print("") print(f"Triangular Pyramid area: {triangular_pyramid_area(base, height, slant_height)}") print(f"Triangular Pyramid volume: {triangular_pyramid_volume(base, height, pyramid_height)}") anykey = input() elif choice == '7': print("") length = float(input("Enter the length of the rectangular pyramid: ")) width = float(input("Enter the width of the rectangular pyramid: ")) slant_height = float(input("Enter the slant height of the rectangular pyramid: ")) height = float(input("Enter the height of the pyramid: ")) print("") print(f"Rectangular Pyramid area: {rectangular_pyramid_area(length, width, slant_height)}") print(f"Rectangular Pyramid volume: {rectangular_pyramid_volume(length, width, height)}") anykey = input() elif choice == '8': print("") radius = float(input("Enter the radius of the cone: ")) slant_height = float(input("Enter the slant height of the cone: ")) height = float(input("Enter the height of the cone: ")) print("") print(f"Cone area: {cone_area(radius, slant_height)}") print(f"Cone volume: {cone_volume(radius, height)}") anykey = input() elif choice == 'q': break else: print("Invalid choice. Please try again.") # Execute the main function if __name__ == "__main__": main()

  • @AbdulAziz-t5s
    @AbdulAziz-t5s 2 місяці тому

    import math def square_area(side): """Calculate the area of a square.""" return side ** 2 def rectangle_area(length, width): """Calculate the area of a rectangle.""" return length * width def circle_area(radius): """Calculate the area of a circle.""" return math.pi * (radius ** 2) def triangle_area(base, height): """Calculate the area of a triangle.""" return 0.5 * base * height def trapezium_area(a, b, height): """Calculate the area of a trapezium.""" return 0.5 * (a + b) * height # Main function to interact with the user def main(): while True: print(" Calculate area of:") print("") print("1. Square") print("2. Rectangle") print("3. Circle") print("4. Triangle") print("5. Trapezium") print("q. Quit") print("") choice = input("Choose an operation or 'q' to quit: ") if choice == '1': print("") side = float(input("Enter the side of the square: ")) print(f"Square area: {square_area(side)}") anykey = input() elif choice == '2': print("") length = float(input("Enter the length of the rectangle: ")) width = float(input("Enter the width of the rectangle: ")) print(f"Rectangle area: {rectangle_area(length, width)}") anykey = input() elif choice == '3': print("") radius = float(input("Enter the radius of the circle: ")) print(f"Circle area: {circle_area(radius)}") anykey = input() elif choice == '4': print("") base = float(input("Enter the base of the triangle: ")) height = float(input("Enter the height of the triangle: ")) print(f"Triangle area: {triangle_area(base, height)}") anykey = input() elif choice == '5': print("") a = float(input("Enter the length of the first parallel side of the trapezium: ")) b = float(input("Enter the length of the second parallel side of the trapezium: ")) height = float(input("Enter the height of the trapezium: ")) print(f"Trapezium area: {trapezium_area(a, b, height)}") anykey = input() elif choice == 'q': break else: print("Invalid choice. Please try again.") # Execute the main function if __name__ == "__main__": main()

  • @AbdulAziz-t5s
    @AbdulAziz-t5s 2 місяці тому

    import java.util.* import kotlin.math.* /*import android.os.Bundle import android.widget.TextView*/ fun main() { var result: Double = 0.000; println("Simple Calculator"); println("1. Addition (+)"); println("2. Subtraction (-)"); println("3. Multiplication (*)"); println("4. Division (/)"); println("5. Percent (%)"); println("6. Square"); println("7. Square Root"); println("8. Logarithm (log10)"); println("9. Remainder"); println("10. Sinus"); println("11. Cosinus"); println("12. Tangen"); println("13. Exit"); println(); print("Enter your choice : "); var choice = readLine()!!.toInt(); when (choice) { 1 ->{ println(); println("Addition (+)"); print("Input first number : "); var num1 = readLine()!!.toDouble(); print("Input second number : "); var num2 = readLine()!!.toDouble(); result = num1 + num2; } 2 ->{ println(); println("Subtraction (-)"); print("Input first number : "); var num1 = readLine()!!.toDouble(); print("Input second number : "); var num2 = readLine()!!.toDouble(); result = num1 - num2; } 3 ->{ println(); println("Multiplication (*)"); print("Input first number : "); var num1 = readLine()!!.toDouble(); print("Input second number : "); var num2 = readLine()!!.toDouble(); result = num1 * num2; } 4 ->{ println(); println("Division (/)"); print("Input first number : "); var num1 = readLine()!!.toDouble(); print("Input second number : "); var num2 = readLine()!!.toDouble(); result = num1 / num2; } 5 ->{ println(); println("Percent (%)"); print("Input number : "); var num1 = readLine()!!.toDouble(); print("Input how many percent(%): "); var num2 = readLine()!!.toDouble(); result = num1 * (num2/100); println("$num2% of $num1 :") } 6 ->{ println(); println("Square"); print("Input number : "); var num1 = readLine()!!.toDouble(); result = num1 * num1; } 7 ->{ println(); println("Square Root"); print("Input number : "); var num1 = readLine()!!.toDouble(); result = sqrt(num1); } 8 ->{ println(); println("Logarithm (log10)"); print("Input number : "); var num1 = readLine()!!.toDouble(); result = Math.log10(num1); } 9 ->{ println(); println("Remainder"); print("Input number : "); var num1 = readLine()!!.toDouble(); print("Input devide number : "); var num2 = readLine()!!.toDouble(); result = num1 % num2; } 10 ->{ println(); println("Sinus"); print("Input angle in degrees: "); var num1 = readLine()!!.toDouble(); // Convert the angle to radians var num1rad = Math.toRadians(num1); // Calculate the sinus var sinus = sin(num1rad); result = sinus; } 11 ->{ println(); println("Cosinus"); print("Input angle in degrees: "); var num1 = readLine()!!.toDouble(); // Convert the angle to radians var num1rad = Math.toRadians(num1); // Calculate the cosinus var cosinus = cos(num1rad); result = cosinus; } 12 ->{ println(); println("Tangen"); print("Input angle in degrees: "); var num1 = readLine()!!.toDouble(); // Convert the angle to radians var num1rad = Math.toRadians(num1); // Calculate the tangen var tangen = tan(num1rad); result = tangen; } 13 ->{ System.exit(0) } } println("Result = $result"); val enter = readLine(); println(); main(); }

  • @AbdulAziz-t5s
    @AbdulAziz-t5s 2 місяці тому

    import tkinter as tk def load_colors(): try: with open("countcolor.txt", "r") as file: colors = file.readlines() return [color.strip() for color in colors] except FileNotFoundError: return ["black", "black", "black", "white"] # default colors def save_colors(): with open("countcolor.txt", "w") as file: file.write(f"{counter_color} ") file.write(f"{increase_button_color} ") file.write(f"{reset_button_color} ") file.write(f"{background_color} ") def increase_counter(): global counter counter += 1 label.config(text=str(counter)) save_colors() def reset_counter(): global counter counter = 0 label.config(text=str(counter)) save_colors() counter = 0 # Load colors from file colors = load_colors() counter_color, increase_button_color, reset_button_color, background_color = colors root = tk.Tk() root.title("Counter App") root.configure(bg=background_color) label = tk.Label(root, text=str(counter), font=("Helvetica", 200), fg=counter_color, bg=background_color) label.pack(pady=100) button_increase = tk.Button(root, text=" Increase ", command=increase_counter, font=("Helvetica",55), fg=increase_button_color, bg=background_color) button_increase.pack(pady=110) button_reset = tk.Button(root, text=" Reset ", command=reset_counter, font=("Helvetica",55), fg=reset_button_color, bg=background_color) button_reset.pack(pady=110) root.mainloop()

  • @AbdulAziz-t5s
    @AbdulAziz-t5s 2 місяці тому

    import math # Basic arithmetic operations def add(x, y): return x + y def subtract(x, y): return x - y def multiply(x, y): return x * y def divide(x, y): if y == 0: return "Error: Division by zero" return x / y # Advanced mathematical functions def power(x, y): return x ** y def sqrt(x): if x < 0: return "Error: Square root of negative number" return math.sqrt(x) def log(x, base=10): if x <= 0: return "Error: Logarithm of non-positive number" return math.log(x, base) # Expression evaluation def evaluate_expression(expression): try: result = eval(expression, {"__builtins__": None}, math.__dict__) return result except Exception as e: return f"Error: {str(e)}" # Main calculator function def calculator(): print("Welcome to the Python Scientific Calculator!") print("Available operations:") print("1. Add") print("2. Subtract") print("3. Multiply") print("4. Divide") print("5. Power") print("6. Square root") print("7. Logarithm") print("8. Evaluate expression") print( ) while True: choice = input("Choose an operation (1-8) or 'q' to quit: ") if choice == 'q': print( ) break if choice in ['1', '2', '3', '4', '5']: x = float(input("Enter first number: ")) y = float(input("Enter second number: ")) if choice == '1': print("Result:", add(x, y)) print( ) elif choice == '2': print("Result:", subtract(x, y)) print( ) elif choice == '3': print("Result:", multiply(x, y)) print( ) elif choice == '4': print("Result:", divide(x, y)) print( ) elif choice == '5': print("Result:", power(x, y)) print( ) elif choice == '6': x = float(input("Enter a number: ")) print("Result:", sqrt(x)) print( ) elif choice == '7': x = float(input("Enter a number: ")) base = float(input("Enter the base (default is 10): ") or "10") print("Result:", log(x, base)) print( ) elif choice == '8': expression = input("Enter a mathematical expression to evaluate: ") print("Result:", evaluate_expression(expression)) print( ) else: print("Invalid choice. Please try again.") # Run the calculator calculator()

  • @AbdulAziz-t5s
    @AbdulAziz-t5s 2 місяці тому

    import java.net.InetAddress import java.util.concurrent.Executors import java.util.concurrent.ScheduledExecutorService import java.util.concurrent.ScheduledFuture import java.util.concurrent.TimeUnit fun main() { var x: Int = 1 val domain = "ns-16.awsdns-02.com" val scheduler: ScheduledExecutorService = Executors.newSingleThreadScheduledExecutor() val pingTask = Runnable { val inetAddress = InetAddress.getByName(domain) println("Pinging $domain($x)...") Thread.sleep(1000) print("#") Thread.sleep(1000) print("#") Thread.sleep(1000) print("#") Thread.sleep(1000) print("#") Thread.sleep(1000) print("#") Thread.sleep(1000) print("#") Thread.sleep(1000) println("#") x++ if (inetAddress.isReachable(1000)) { println("Ping successful!") println() Thread.sleep(1000) //clearScreen() //print("\u001B[H\u001B[2J") } else { println("Ping failed!") } } val scheduledFuture: ScheduledFuture<*> = scheduler.scheduleAtFixedRate(pingTask, 0, 3, TimeUnit.SECONDS) // Keep the program running indefinitely while (true) { // Do nothing } }