Run ❯
Get your
own
website
×
Change Orientation
Change Theme, Dark/Light
Go to Spaces
Python
JavaScript
Java
C++
myFruits = ['banana','apple','orange'] myFruits.pop() print(myFruits) #Python
const myFruits = ['banana','apple','orange']; myFruits.pop(); console.log(myFruits); //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"); myFruits.remove(myFruits.size()-1); System.out.println(myFruits); } } //Java
#include
#include
#include
using namespace std; int main() { vector
myFruits = {"banana", "apple", "orange"}; myFruits.pop_back(); for(const string& fruit : myFruits){ cout << fruit + " "; } cout << "\n"; return 0; } //C++
Python result:
JavaScript result:
Java result:
CPP result:
['banana', 'apple']
banana,apple
[banana, apple]
banana apple