Code Editor
main.py
+ New file
Python Function
Python Class
JavaScript Function
HTML Template
CSS Animation
Console
Program output will appear here...
Tips & Tasks
Task #1: First program

Create a simple Python program that prints "Hello, World!" and the current date.

import datetime

print("Hello, World!")
current_date = datetime.datetime.now()
print(f"Today is: {current_date.strftime('%Y-%m-%d')}")
Task #2: Calculator

Create a simple calculator that performs basic mathematical operations.

def calculator(a, b, operation):
    if operation == '+':
        return a + b
    elif operation == '-':
        return a - b
    elif operation == '*':
        return a * b
    elif operation == '/':
        return a / b
    else:
        return "Unknown operation"

# Example usage
print(calculator(10, 5, '+'))
Task #3: HTML Page

Create a simple HTML page with a title, paragraph, and image.

<!DOCTYPE html>
<html>
<head>
    <title>My Page</title>
</head>
<body>
    <h1>Welcome to my page!</h1>
    <p>This is a simple HTML example.</p>
    <img src="https://via.placeholder.com/150" alt="Placeholder">
</body>
</html>
Task #4: CSS Styling

Add CSS styling to the previous HTML page.

body {
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
    margin: 0;
    padding: 20px;
}

h1 {
    color: #333;
    text-align: center;
}

p {
    color: #666;
    line-height: 1.6;
}

img {
    display: block;
    margin: 20px auto;
    border: 5px solid #333;
    border-radius: 10px;
}
Task #5: JavaScript

Create a simple JavaScript script that displays an alert when a button is clicked.

<!DOCTYPE html>
<html>
<head>
    <title>JavaScript Example</title>
</head>
<body>
    <button id="myButton">Click me!</button>
    
    <script>
        document.getElementById('myButton').addEventListener('click', function() {
            alert('Button was clicked!');
        });
    </script>
</body>
</html>