Changes

Jump to navigation Jump to search
478 bytes added ,  12:24, 25 August 2016
no edit summary
Line 181: Line 181:     
24. In how many different ways can the letters of the word 'CORPORATION' be arranged so that the vowels always come together?
 
24. In how many different ways can the letters of the word 'CORPORATION' be arranged so that the vowels always come together?
 +
===Answer===
 +
word = "CORPORATION";
 +
vowels ="AEIOU";
 +
vowelsarray=vowels.split("");
 +
wordletterswithoutvowels=word.split("").filter((x)=>!x.isin(vowelsarray));
 +
vowellettersfromtheword=word.split("").filter((x)=>x.isin(vowelsarray));
 +
length1=wordletterswithoutvowels.count();
 +
length2=vowellettersfromtheword.count();
 +
totalletters = length1+1;
 +
repeatedletters=2;
 +
repeatedvowelletters=3;
 +
 +
TotalWords = (totalletters!/repeatedletters!)*(length2!/repeatedvowelletters!);
 +
TotalWords;
    
25. In a shop there are Jeans, Pants, Shirts and Tops of colors black, blue, grey etc and prices $20 to $200. Write a program for selection of Jeans, blue in color, that is priced between $50 and $100. If there are no Jeans, get grey color pants priced less than $50.
 
25. In a shop there are Jeans, Pants, Shirts and Tops of colors black, blue, grey etc and prices $20 to $200. Write a program for selection of Jeans, blue in color, that is priced between $50 and $100. If there are no Jeans, get grey color pants priced less than $50.
writer
5,435

edits

Navigation menu