“Sets” Réponses codées

sets

 
DaysA = set(["Mon","Tue","Wed"])
DaysB = set(["Wed","Thu","Fri","Sat","Sun"])
AllDays = DaysA|DaysB
print(AllDays)
Yucky Yacare

Sets

// Java program Illustrating Set Interface
 
// Importing utility classes
import java.util.*;
 
// Main class
public class GFG {
   
    // Main driver method
    public static void main(String[] args)
    {
        // Demonstrating Set using HashSet
        // Declaring object of type String
        Set<String> hash_Set = new HashSet<String>();
 
        // Adding elements to the Set
        // using add() method
        hash_Set.add("Geeks");
        hash_Set.add("For");
        hash_Set.add("Geeks");
        hash_Set.add("Example");
        hash_Set.add("Set");
 
        // Printing elements of HashSet object
        System.out.println(hash_Set);
    }
}
Ill Ibis

Réponses similaires à “Sets”

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code