Skip to content

CompuGit/Python_programs

Repository files navigation

Python Programs

Hello Folks..! 

You can find the list of program questions and their solutions here, which are level wise categorized as per the lecutres in the contents. I request you don not directly ahead for program solution. 

Please try yourself first and improve you coding skills. if not satisfied with your code then only refer to the soltion.

I hope everyone a good luck and wish you a happy coding.... :)

After Bonus Lecture 1

Stage 1 Programs

1.  Generate a 6-digit random number
2.	Find the 5th root of 80 i.e. 5√80
3.	Do the following operations with complex numbers
    •	Complex number added with another complex and scalar
    •	Complex number subtracted with another complex and scalar
    •	Complex number multiplied with another complex and scalar
    •	Complex number divided with another complex and scalar
4.	Find the length of bits occupied, number of 1’s and 0’s in a given integer n = 158 
5.	Do the following conversions
    •	(13)10 – (?)2, (?)8, (?)16
    •  	(0b10101001)2 – (?)10, (?)8, (?)16
    •	(0o71)8 – (?)2, (?)10, (?)16
    •	(0xE2F3)16 – (?)2, (?)8, (?)10

After Bonus Lecture 2

Stage 2 Programs

1.	WAP to reverse the words in a string and capitalize the first letter
    #Input : 'I am a boy'
    #Output : 'Boy a am i'

2.	WAP to print WoW where letter o is repeated k times
    #Input : k=5
    #Output : WoooooW

3.	Find number of sentences, words, letters, spaces in the given statement.
    ‘The quick brown fox jumps over a lazy dog. 1234567890.’

After lecture 5

Stage 3 Programs

1.	Create a file called account and put 1000 coins in it. 
    Read account and use coins to buy goods which as follows
    •	Pens 4 packs, each pack of 20 pens costs 50coins/pack
    •	3 Books one for 10 coins and two for 15 coins each
    •	A bag for 100 coins
    Now add all these goods in to goods file and update the account with remaining balance.
    Show the initial, remaining balance and goods to the output.

  After lecture 6

Stage 4 Programs

1.	Update the above account-goods program with dynamic inputs i.e.
    •	Coins should ask from user
    •	N Goods and its costs should collect from user

After lecture 7

Stage 5 Programs

1.	WAP to get an input number and verify it is valid or not
    #valid if it starts with 9,8,7,6 and having exactly 10 digits

2.	WAP to print the following pattern
    *******
     *****
      ***
       *
3.	WAP to print desired math table for n X k

4.	WAP to get any two numbers from user to start Fibonacci series until k numbers
    #Input : 0 1 12 # 0 and 1 are the two number and k is 12
    #Output : 0 1 1 2 3 5 8 13 21 34 55 89

5.	WAP to count characters and compress the given string.
    #Input : aaaabbbccdaa
    #Output : 4a3b2c1d2a

Test - 1

After lecture 8

Stage 6 Programs

1.	WAP to find min and max number in an array and print in (min, max) tuple format.
    #Input : [2,4,5,1,3]
    #ouput : (1,5)

2.	WAP to find given anagram available in the other string, if yes print their indices.
    #Input : 'baccbbbdabcdbca' 'abc'
    #Output : [0,8,12]  

3.	WAP to play the cards game where cards are all arranged front and back
    and we need to remove a card if it is 0 and flip all the other cards if it is 1
    at the last if the is 1 we win else we loose

After lecture 9

Stage 7 Programs

1.	WAP to count the repeated words in a string
    #Input : 'abc bca cba cab abc acb bca acb'
    #Output : abc=2 bca=2 cba=1 cab=1 acb=2

2.	create a phonebook with the following names and their numbers respectively. print now the phonebook.
    #Andrew Parson = 8806336
    #Emily Everett = 6784346
    #Peter Power = 7658344
    #Lewis Lame = 1122345

    do the necessary modifications to the phonebook as follows
     1. Andrew's number is wrongs update it to 8806334 and show phone book
     2. add Gingerbread John to phonebook yet he doesn’t have any phone number so keep it None and show
     3. show all the persons
     4. show all the phone numbers
     5. now create addressbook for the users from phonebook

After Lecture 10

Stage 8 Programs

1.	WAP to Minimize the sum of an array where all its maximum numbers 
    will be reduced to half for the given k times.

2.	WAP to find the rotated string
    #Input : ABCD
    #Ouput : ABCD BCDA CDAB DABC

3.	WAP to find all the trailing numbers from the given list whose sum exactly equals k
    #Input : arr = [5,3,8,2,1,10,1]; k = 11
    #output : [3, 8] [8, 2, 1] [1, 10] [10, 1]

After lecture 11

Stage 9 Programs

1.	WAP to find the factorial of n using non-recursive and recursive function methods
    #Input : n=5
    #Output : 120

2.	WAP to limit the keystrokes for a string using functions the input considered to the list of character and limt separated by comma and a given string text
    #Input : lst = ['e,3','t,5','a,1','s,1']; text = 'statement is a statement'
    #Output : 'statement i  ttemn'

3.	write a function check if given string is balanced with brackets or not
    #Input : '( ( ) [ ( ) ] { ( ) } )' #Output : True
    #Input : '( ( ) { [ } )' #Output : False

Test - 2

Start Oops with Py Lectures along with the below mini-projects

Mini projects at the end of all core concepts

There are given google-python-exercises and a mini game rock papers scissors
Visit those and write the code for them as desired accoring the their outputs.

Please dont look into solution unless you tried first.

Good luck...! :)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published