Skip to content

BhartiAbhinav/Python-sample-programs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

anagra.py -

          function that takes two strings and returns True if they are anagrams and False otherwise. 
         A pair of strings is anagrams if the letters in one word can be arranged to form the second one. 
         Test case1: input: listen silent output: True

fibona.py-

          a recursive function to print nth term of the Fibonacci sequence.

palind.py-

          a recursive function to check whether a string is a palindrome.

facto.py-

          a recursive function in Python to find the factorial of a number.

missi.py-

          a program that uses a for loop to"count mississippily" to
          five. Having counted to five, the program should print to the screen the final message "Ready or not, here I come!

whiles.py-

          a program that uses a while loop and continuously asks the user to enter a word unless the user enters chupacabra 
          as the secret exit word, in which case the message You've successfully left the loop. should be printed to the
          screen,  and the loop should terminate.

voweleater.py -

            ask the user to enter a word;
            use conditional execution and the continue statement to eat the following vowels
            A, E, I, O, U from the inputted word;
            print the uneaten letters to the screen, each one of them on a separate line.

twolines.py-

            Using one of the comparison operators in Python, write a simple two-line program that takes the parameter;
            n as input, which is an integer, and prints False if n is less than 100, 
            and True if n is greater than or equal to 100.

pyarmid.py-

            task is to write a program which reads the number of blocks the builders have, and outputs the height of th 
            pyramid that can be built using these blocks;
            he height is measured by the number of fully completed layers - if the builders don't have a sufficient number
            of blocks and cannot complete the next layer, they finish their work immediately.
            The pyramid is stacked according to one simple principle: each lower layer contains one block more than the layer 
            above.

lineinverse.py-

            Reverse the contents of a list without using the reverse() method of a list and without using slicing.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages