โผ Latest
Code humanizer
Free mode
100% free
Freemium
Free Trial
-
2,6838471,134Released 3mo ago100% Free/* Creative Calculator */ body { margin: 0; display: flex; justify-content: center; align-items: center; height: 100vh; background: linear-gradient(135deg, #f0f4f8, #a3c9ff); font-family: "Segoe UI", sans-serif; } .calculator { background: #ffffff; padding: 25px; border-radius: 25px; box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2); width: 300px; } .display { background: #eef6ff; color: #333; padding: 20px; border-radius: 15px; text-align: right; font-size: 1.7rem; margin-bottom: 20px; min-height: 50px; box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.1); overflow-x: auto; } .buttons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; } button { border: none; padding: 15px; border-radius: 15px; font-size: 1.2rem; cursor: pointer; background: #dbe9ff; transition: all 0.2s ease-in-out; } button:hover { background: #6fa8ff; color: white; transform: scale(1.05); } .equal { grid-column: span 2; background: #4c7ee8; color: white; font-weight: bold; } .clear { background: #ff6767; color: white; } .special { background: #ffd966; } </style> <div class="calculator"> <div id="display" class="display"></div> <div class="buttons"> <button class="special">Ans</button> <button>C</button> <button>7</button> <button>8</button> <button>9</button> <button>/</button> <button>4</button> <button>5</button> <button>6</button> <button>*</button> <button>1</button> <button>2</button> <button>3</button> <button>-</button> <button>0</button> <button>.</button> <button>+</button> <button class="equal">=</button> </div> </div> <script> // Get the display element and all buttons const displayElement = document.getElementById('display'); const buttons = document.querySelectorAll('button'); // Store the current calculation and previous answer let currentCalculation = ''; let previousAnswer = ''; // Add event listeners to all buttons buttons.forEach(button => { button.addEventListener('click', handleButtonClick); }); // Handle button clicks function handleButtonClick(event) { const button = event.target; const buttonText = button.textContent; // Handle equals button if (buttonText === '=') { try { // Evaluate the current calculation const result = eval(currentCalculation); displayElement.textContent = result; previousAnswer = result; currentCalculation = result.toString(); } catch (error) { displayElement.textContent = 'Error!'; currentCalculation = ''; } } // Handle clear button else if (buttonText === 'C') { displayElement.textContent = ''; currentCalculation = ''; } // Handle answer button else if (buttonText === 'Ans') { currentCalculation += previousAnswer; displayElement.textContent = currentCalculation; } // Handle digit or operator button else { currentCalculation += buttonText; displayElement.textContent = currentCalculation; } } </script>
Other tools
-
702264245Released 1mo ago100% FreeTareq Al moursi๐ 3 karmaAug 19, 2025I'd love to help you breathe some life into your article about the benefits of exercise. To get started, could you share the text with me? That way, I can get a feel for your writing style and the tone you're aiming for. Also, just to clarify, are you looking for a casual and conversational tone, or something more professional and informative? Any guidance you can provide will help me tailor the rewrite to your needs. Please go ahead and share the article, and I'll do my best to make it engaging, easy to read, and true to your original message. (If you have any specific instructions or a preferred tone in mind, feel free to let me know and I'll do my best to accommodate them.)
-
365114119Released 9mo ago100% Free
-
805347314Released 8mo ago100% Free
-
Transform dry text into engaging, human-like content.Open1,524219573Released 1y ago100% Free
- Spotlight: Jason AI (Sales)
-
2213661Released 11mo ago100% Free
-
3241451Released 1y ago100% Free
-
Generate hyper-realistic human portraits with AI precision.Open944Released 5d ago100% Free
-
1,114248263Released 11mo ago100% Free
-
781276203Released 8mo ago100% Free
-
370101104Released 9mo ago100% Free
-
AI-powered text rewriting that sounds human.Open3,418659643Released 1y ago100% FreeEven after giving it some work I kept getting ---> Iโm ready to help, but it seems thereโs no input text provided. Please provide the text youโd like me to rewrite, and Iโll get started. Once you provide the text, Iโll apply the tasks listed above to create a rewritten version that meets the requirements. Please go ahead and provide the input text, and Iโll begin the rewriting process.
-
1155Released 28d ago100% Free
- Didn't find the AI you were looking for?
-
614165182Released 9mo ago100% Free
-
Open1787Released 28d ago100% Free
Ask the community
Nabasa Isaac
๐ 1 karma
Oct 31, 2024
# Part (a): Add a Student
def add_student(student_list, student_id, name, age, course):
# Check for unique student ID
for student in student_list:
if student['student_id'] == student_id:
print(f"Error: Student ID {student_id} already exists!")
return
# Add the new student
student_list.append({
'student_id': student_id,
'name': name,
'age': age,
'course': course
})
print(f"Student {name} added successfully.")
# Part (b1): Find a Student by ID
def find_student_by_id(student_list, student_id):
for student in student_list:
if student['student_id'] == student_id:
return student
print("Student not found!")
return None
# Part (b2): Remove a Student by ID
def remove_student_by_id(student_list, student_id):
for student in student_list:
if student['student_id'] == student_id:
student_list.remove(student)
print(f"Student ID {student_id} removed successfully.")
return
print("Student not found!")
# Part (c): Class Definitions
class Person:
def __init__(self, name, age):
self.name = name
self.age = age
def __str__(self):
return f"Name: {self.name}, Age: {self.age}"
class Student(Person):
def __init__(self, name, age, course):
super().__init__(name, age)
self.course = course
def study(self):
print(f"Student is studying {self.course}")
class Instructor(Person):
def __init__(self, name, age, subject):
super().__init__(name, age)
self.subject = subject
def teach(self):
print(f"Instructor is teaching {self.subject}")
# Demonstration of polymorphism
student1 = Student("Alice", 20, "Mathematics")
instructor1 = Instructor("Bob", 40, "Physics")
print(student1) # Uses __str__ from Person
student1.study() # Calls study method from Student
print(instructor1) # Uses __str__ from Person
instructor1.teach() # Calls teach method from Instructor
# Part (d): Higher-order function for sorting students
def sort_students(student_list, key_function):
return sorted(student_list, key=key_function)
# Sample student list
students = [
{"student_id": 1, "name": "Alice", "age": 20, "course": "Mathematics"},
{"student_id": 2, "name": "Bob", "age": 22, "course": "Physics"},
{"student_id": 3, "name": "Charlie", "age": 19, "course": "Chemistry"}
]
# Demonstrate sorting by age
sorted_by_age = sort_students(students, key_function=lambda s: s["age"])
print("Students sorted by age:", sorted_by_age)
# Demonstrate sorting by name
sorted_by_name = sort_students(students, key_function=lambda s: s["name"])
print("Students sorted by name:", sorted_by_name)
Post