100 runnable code examples.
Open any example to explore the code and run it online. No setup, no signup.Open any example to explore the code, edit it and run it on the CompileBytes engine — no setup, no signup.
100 of 100 examples
Python
20How to reverse a string in PythonHow to remove duplicates from a list in PythonHow to merge two dictionaries in PythonHow to flatten a list of lists in PythonHow to find the index of a list item in PythonHow to get the current date and time in PythonHow to convert bytes to a string in PythonHow to list all files in a directory in PythonHow to concatenate two lists in PythonHow to check if a list is empty in PythonHow to slice a list in PythonHow to count occurrences in a list in PythonHow to remove a key from a dictionary in PythonHow to check if a key exists in a dictionary in PythonHow to sort a dictionary by value in PythonHow to convert two lists into a dictionary in PythonHow to check if a string contains a substring in PythonHow to join a list into a string in PythonHow to convert a string to an int in PythonHow to loop with an index in Python
Go
20How to reverse a string in GoHow to convert a string to an int in GoHow to check if a key exists in a map in GoHow to check if a slice contains an element in GoHow to sort a slice in GoHow to remove an element from a slice in GoHow to check if a string contains a substring in GoHow to split a string in GoHow to concatenate strings in GoHow to trim whitespace from a string in GoHow to convert an int to a string in GoHow to iterate over a map in GoHow to remove a key from a map in GoHow to remove duplicates from a slice in GoHow to loop with an index in GoHow to convert a struct to JSON in GoHow to parse JSON into a struct in GoHow to format a date in GoHow to wait for goroutines to finish in GoHow to handle errors in Go
JavaScript
20How to remove an item from an array in JavaScriptHow to remove a property from an object in JavaScriptHow to check if a string contains a substring in JavaScriptHow to loop through an array in JavaScriptHow to replace all occurrences of a string in JavaScriptHow to capitalize the first letter of a string in JavaScriptHow to deep clone an object in JavaScriptHow to check if an array contains a value in JavaScriptHow to round to 2 decimal places in JavaScriptHow to sort an array of objects by property in JavaScriptHow to check if a key exists in an object in JavaScriptHow to loop through an object in JavaScriptHow to merge two objects in JavaScriptHow to use async/await in a loop in JavaScriptHow to remove duplicates from an array in JavaScriptHow to format a number with commas in JavaScriptHow to convert a string to a number in JavaScriptHow to flatten an array in JavaScriptHow to find an object in an array by property in JavaScriptHow to check for null or undefined in JavaScript
Java
20How to convert a string to an int in JavaHow to iterate over a map in JavaHow to convert an array to a list in JavaHow to generate a random number in a range in JavaHow to check if an array contains a value in JavaHow to initialize a list in one line in JavaHow to declare and initialize an array in JavaHow to print an array in JavaHow to convert a string to an enum in JavaHow to break out of nested loops in JavaHow to split a string in JavaHow to sort a Map by value in JavaHow to read a file into a String in JavaHow to round to 2 decimal places in JavaHow to concatenate two lists in JavaHow to sort a list of objects by property in JavaHow to compare strings in JavaHow to join a list into a string in JavaHow to remove items from a list while iterating in JavaHow to get the current date and time in Java
C#
20How to loop through an enum in C#How to convert an int to an enum in C#How to check if a string contains a substring in C#How to iterate over a dictionary in C#How to deep clone an object in C#How to catch multiple exceptions in C#How to generate a random number in a range in C#How to calculate the difference between two dates in C#How to check for null in C#How to sort a list of objects by property in C#How to convert a byte array to a hex string in C#How to convert a string to a byte array in C#How to convert a string to an enum in C#How to remove duplicates from a list in C#How to loop with an index in C#How to group by with LINQ in C#How to convert an object to JSON in C#How to parse JSON into an object in C#How to convert a string to an int in C#How to join a list into a string in C#
Questions & answers
Examples, explained
Yes. Open any example to edit and run its code on the CompileBytes engine without installing anything.