Y

@yescode1

fdf

Python
24 minutes ago
# 01-swap.py # Topic: Swap Without a Third Variable, XOR Swap input("XOR swap - exchange two values without a third variable. Press Enter ") print(" before: a = 5 b = 9") a, b = 5, 9 a ^= b; b ^= a; a ^= b print(" after: a =", a, " b =", b)

detection

Python
2 days ago
if results.multi_hand_landmarks and results.multi_handedness: for idx, hand_landmarks in enumerate(results.multi_hand_landmarks): hand_label = results.multi_handedness[idx].classification[0].label gesture = detec

fav

Python
3 weeks ago
<!DOCTYPE html> <html> <head> <style> body { font-family: Arial, sans-serif; background: aliceblue; text-align: center; padding: 30px;

yuilu

Python
3 weeks ago
if coin != 1 and coin != 5 and coin != 10 and coin != 25: print("Invalid coin, try again!\n") continue total_inserted += coin coins_inserted += 1 print(f"Inserted {coin}. Total so far: {total_inserted}\n") if t

yuilu

Python
3 weeks ago
<!-- put values safely into HTML attributes --> <div id="mapContainer" data-lat="{{ data.latitude if data and data.latitude else '' }}" data-lon="{{ data.longitude if data and data.longitude else '' }}" ></div> <script> con

yt

Python
3 weeks ago
print('Hello world!')

iyutui

Python
3 weeks ago
# ---- PART 2: Box Plot, Strip Plot and Swarm Plot ---- sns.boxplot(x='day', y='total_bill', data=df) plt.title('Spread of Total Bill per Day') plt.xlabel('Day') plt.ylabel('Total Bill ($)') plt.show() sns.stripplot(x='day', y='total_bill', data=

yt

Python
3 weeks ago
from flask import Flask, render_template, request app = Flask(__name__) @app.route("/") def home(): return render_template("index.html") @app.route("/calculate", methods=["POST"]) def calculate(): units = int(request.form["units"]) bill

k

Python
4 weeks ago
<!DOCTYPE html> <html> <head> <title>My Game Profile</title> <style> body { font-family: Arial, sans-serif; background: aliceblue; text-align: center; padding: 30px;

yiu

Python
1 month ago
from hf import generate_response def get_essay_details(): print("\n=== AI Writing Assistant ===\n") topic = input("What is the topic of your essay? ").strip() essay_type = input("What type of essay are you writing? ").strip() length

iyutui

Python
1 month ago
initial_response = generate_response(prompt, temperature=0.3, max_tokens=1024) print(f"\nInitial AI Response: {initial_response}") modified_prompt = input( "Modify the prompt to make it more neutral (e.g., 'Describe the qualitie

yuilu

Python
1 month ago
classifier = Sequential() # Add the input layer and the first hidden layer classifier.add(Dense(units = 6, kernel_initializer = 'he_uniform',activation='relu',input_dim = 10)) # Add the second hidden layer classifier.add(Dense(units = 6, kernel_in

yuilu

Python
1 month ago
initial_response = generate_response(prompt, temperature=0.3, max_tokens=1024) print(f"\nInitial AI Response: {initial_response}") # Rating + feedback (simulated RL) try: rating = int(input("Rate the response from 1 (bad)

yt

Python
1 month ago
category = input("Enter a category (e.g., animal, food, city): ").strip() item = input(f"Enter a specific {category} to classify: ").strip() if not category or not item: print("Please fill in both fields to run the activity.")

jk

Python
1 month ago
def generate_image(prompt: str): safe, err = is_prompt_safe(prompt) if not safe: return None, err try: image = img_client.text_to_image(prompt=prompt, model=IMG_MODEL) return image, N

jk

Python
1 month ago
from sklearn.model_selection import train_test_split X_train, X_test, y_train, y_test = train_test_split(x, y, test_size=0.2, random_state=0) # create model model = Sequential() model.add(Dense(10, input_dim=10, kernel_initializer='normal', activa

multi

Python
1 month ago
# main_part1 (Streamlit) import io, requests, re from io import BytesIO import streamlit as st from huggingface_hub import InferenceClient import config from groq import generate_response # from hf import generate_response MATH_SYSTEM = """You ar

uki

Python
1 month ago
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>My Phone Contact</title> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet"> <style> body { background-color

iyutui

Python
1 month ago
if choice == "1": sobel_x = cv2.Sobel(gray_image, cv2.CV_64F, 1, 0, ksize=3) sobel_y = cv2.Sobel(gray_image, cv2.CV_64F, 0, 1, ksize=3) combined_sobel = cv2.bitwise_or(sobel_x.astype(np.uint8), sobel_y.as

catbot

Python
1 month ago
import re, random from colorama import Fore, init # Initialize colorama (autoreset ensures each print resets after use) init(autoreset=True) # Destination & joke data destinations = { "beaches": ["Bali", "Maldives", "Phuket"], "mountains":