Run ❯
Get your
own
website
×
Change Orientation
Change Theme, Dark/Light
Go to Spaces
Python
JavaScript
Java
C++
myFruits = ['banana','apple','orange'] print(len(myFruits)) #Python
const myFruits = ['banana','apple','orange']; console.log(myFruits.length); //JavaScript
import java.util.ArrayList; public class Main { public static void main(String[] args) { ArrayList
myFruits = new ArrayList
(); myFruits.add("banana"); myFruits.add("apple"); myFruits.add("orange"); System.out.println(myFruits.size()); } } //Java
#include
#include
#include
using namespace std; int main() { vector
myFruits = {"banana", "apple", "orange"}; cout << myFruits.size(); return 0; } //C++
Python result:
JavaScript result:
Java result:
CPP result:
3
3
3
3