Showing posts with label Python. Show all posts
Showing posts with label Python. Show all posts

Friday 25 April 2014

Hexadecimal encoder & decoder in Python

Best thing , I love about Python is, It has lots of inbuilt Pre-defined functions . which shorten our code by a large extend .


Hexadecimal encoding & decoding is very easy & need only few lines of  in python . 

Here Is Python2.7 code for Hex conversion from string ,and from Hex to string 

Tuesday 4 March 2014

Ways to find Factorial of a Number

This is very frequent direct or indirect questions, we found To find out factorial of a number . There are Many ways to find out factorial of a number .

Factorial of a number :

N factorial =  N! = N*(N-1)*(N-2)*(N-3) ...... *3*2*1

It is basically product of all positive number greater than equal to N .
Ex:
       4! = 4*3*2*1 =24
       5!=5*4! =%*4*3*2*1 =120
      7!=7*6*5*4*3*2*1 = 5040

Note : Factorial of  0 = 0! =1

Thursday 27 February 2014

Test your Programming Skill : P-2

Our today's Programming Problem is quite  easier . It uses your Basic mathematics skill of School level But Really This Problem Test your skills .

You Have to Find Number of Zeros at end of factorial of a number without using real factorisation
  example : let No be 15 then 15 ! (15 factorial ) =1*2*3* ..........*13*14*15
                 and you have to find out number of Zero's at end of 15 ! = 3
                as 15!=1307674368000 .

I Gave you some results  to check your Program output .  So hurry Up .

Friday 14 February 2014

Print n time Without Loop

How to print any thing n times Without Using any LOOP :

this is very easy & very common question : ask to check your recursion Programming  Basics .



It is really very easy : you just have to make a simple function

I gave you source code for this program in C & Python I hope it definitely  help you  if you are unable to get it .


Blogger Widgets