Contains Simple codes for Python Core practice like:
1.Tic Tac Toe game without graphics file.
2.Find all such numbers which are divisible by 7 but are not a multiple of 5, between 2000 and 3200 (both included). The numbers obtained should be printed in a comma-separated sequence on a single line.
Eg. 2001,2002,2003,.....
3.Generate a dictionary that contains (i, i*i) such that is an integral number between 1 and n (both included). and then the program should print the dictionary.
Suppose the following input is supplied to the program: Input: 8 Output: {1: 1, 2: 4, 3: 9, 4: 16, 5: 25, 6: 36, 7: 49, 8: 64}
4.Write a function which takes 2 digits, X,Y as input and generates a 2-dimensional array. The element value in the i-th row and j-th column of the array should be i*j. For Eg: Input: matrix(3,3) O/P: [[0,0,0],[1,1,1],[2,2,2]]
5.Write a function that accepts a sentence and calculate the number of letters and digits. Input: hello world! 123 Output:LETTERS 10 DIGITS 3
6.Write a function to compute the frequency of the words from the input. The output should output after sorting the key alphanumerically. Input: New to Python or choosing between Python 2 and Python 3? Read Python 2 or Python 3. Output: 2:2 3.:1 3?:1 New:1 Python:5 Read:1 and:1 between:1 choosing:1 or:2 to:1
7.2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder. What is the smallest positive number that isevenly divisible by all of the numbers from 1 to 20?
8.Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be: 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ... By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms.
9.Stack Using Linked List Data Structure.
10.A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99. Find the largest palindrome made from the product of two 3-digit numbers.