Posts

The number of 6-digit even numbers that can be made from the number 214635 are:

Image
The number of 6-digit even numbers that can be made from the number 214635 are:  a) 18 b) 72  c) 120 d) 360 Answer:  D from the question we can see we have to form 6 digit number(no repetition) so, let us six blanks as show below : _ _ _ _ _ _  if the number has to be even it has to be end with even number. 214635   from the above digits even numbers are 2,4,6 so, the units digit is 2 or 4 or 6 so, the no.of.ways is 3 remaining 5 digits can be filled with 5! ways  so, the answer is 5!x3 ways                             = 360 ways  remaini

The number of ways in which 8 different flowers can be strung to form a garland so that 4 particular flowers are never separated are? | cts previous year aptitude questions

Image
 The number of ways in which 8 different flowers can be strung to form a garland so that 4 particular flowers are never separated are? ( cts previous year aptitude questions ) a) 960 b)2880 c)288 d)576 Answer: D The concept used is Permutations  . The keyword to be  observed is "garland" i.e , the circular permutations  (n-1)! ways. 8 different flowers can be arranged in 7! ways { (n-1)! } The 4 flowers never can be separated . let us consider those 4 flowers as a one unit. now , the total number of ways are 4! The flowers that are put together can arrange themselves in 4! ways  So, The total ways are 4!x4!  24 x 24 576 ways  

If the sum of 4 times a number A and three times a number B is equal to the sum of number B and seven times the number A, then what is the value of A:B? | CTS previous Aptitude question

Image
 If the sum of 4 times a number A and three times a number B is equal to the sum of number B and seven times the number A, then what is the value of A:B? ( CTS Aptitude question) Options:  a) 2:3 b) 3:2 c) 4:3 d) 3:4 Answer : A The above question can be written in below form  4A + 3B = B + 7A 4A - 7B = B - 3B -3A  = -2B hence the answer is A:B = 2:3 

Python program to check whether the PIN entered by the user is four digit number or not

Image
  Algorithm  Step 1 : start Step 2: declare a string  Step 3: return the length of list by using len function  Step 4 : check the len == 4 then print " user has entered four digit pin " if not print " invalid number of digits "  Program :  pin = input(" enter the pin : " ) i = len(pin)  if  i == 4:   print("user has entered four digit pin ") else:   print(" invalid number of digits")

Python dictonaries

Image
  Good day !!          Hello guys , have a recap at my previous blog . I have explained about tuples.  Previous Context of blogs DICTIONARIES  Operations  Accessing  Updating  Deleting  Length            Today we are  going to learn about dictionaries in python . As we have got many data types(lists , tuples  ... ) why still we are using dictionaries , right ?    You will have a clear idea at the end of this blog . Let's start now !!  Let me explain the disadvantages of list First . In list we cannot access the two different variables at a time . Warch this video for explanation.  Dictionaries        Dictionaries are very unique to other data types . It should be embedded in curly parenthesis "{}". It has two sections one is key and value pair . Dictionaries works  on key-value pair .  Syntax  dict = {k1 : v1 , k2 : v2 , ....... } Key...

Python tupes

Image
 Hello friends, today we are going to dicuss about   tuples  . It is one of the data type in python . Take a look at  before blog  Previous . Table of contents  Tuples  And its Operations First,let's try to learn the syntax of the tuples  A = (var1 , var2 , var3 , var4 .........) Here,  A is name of the tuple  var1 ,var2, var3 ... are elemnts in the tuple. The biggest advantage in the tuples is you have amy any yype of values(string , int, float ) in one tuple. tup = ("apples", "pineapple ",1,7,5) In the above  video I told tuples are immutable (cannot be updated ) . Try lets try to update it, how does python teacts .   Indexing tup = ("apple", "pineapples",1,7 ,5) tup[0] # accessing index 0 element  tup[3] # accessing index 3 element  Slicing  : tup = ("apples","pineapple",1,7,5) tup[0:3] Operations       Concatenation   tup = ("apples","pineapple",1,7,5) tup2 = (3,2,8) tup + tup2  ...

Python lists

Image
 Our wonderful journey is still continued.  Please have a watch on the before blog because this blog  is extension to vefore blog  . Have a look at that Previous .  Context Lists  Operations  Indexing  Slicing  Updating the list Some inbulit functions PYTHON LISTS  What is use of lists ? It is used to make a collection of items. Like in the above pictures. In this list , we can store in all data types like string, integer etc,. Syntax : A = [var1 , var2, var3.. ........] where,  A = name of the list  var1,var2,vars are the elements in the list.  Eg : list = ["apples", "banana", "cherry"] See this video 👇👇👇👇 Lets move on to operations in lists  Indexing  : Same what we have learnt in strings.  Previous Syntax  :  List[0] # for accessing the first element in list List[1] # second element Slicing  : Even this also same as it string. Previous Eg :  list[0:2]  # prints the elements i...

Popular posts from this blog

Python tupes

Python dictonaries

If the sum of 4 times a number A and three times a number B is equal to the sum of number B and seven times the number A, then what is the value of A:B? | CTS previous Aptitude question