gpt-4o-2024-08-06· OpenAI
WildChat-4.8M (AI2)
Untitled conversation
- User
Assistant: User: [Try 46]Give me a one line python func Assistant:
- Assistant
Certainly! Here's a one-liner Python function that calculates the square of a number:
square = lambda x: x**2You can call this function with a number as its argument, like so:
square(5), and it will return25.