2.3 Generate first ‘n’ prime numbers This program may be done using functions.
WAP to create a pyramid of the character ‘*’ and a reverse pyramid.
WAP that accepts a character and performs the following:
4.1 print whether the character is a letter or numeric digit or a special character
4.2if the character is a letter, print whether the letter is uppercase or lowercase
4.3 if the character is a numeric digit, prints its name in text (e.g., if input is 9,
output is NINE)
WAP to perform the following operations on a string
5.1 Find the frequency of a character in a string.
5.2 Replace a character by another character in a string.
5.3 Remove the first occurrence of a character from a string.
5.4 Remove all occurrences of a character from a string.
WAP to swap the first n characters of two strings.
Write a function that accepts two strings and returns the indices of all the occurrences
of the second string in the first string as a list. If the second string is not present in the
first string then it should return -1.
WAP to create a list of the cubes of only the even integers appearing in the input list.
WAP to accept a name from a user. Raise and handle appropriate exception(s) if the text entered
by the user contains digits and/or special characters.
WAP to define a class Point with coordinates x and y as attributes. Create
relevant methods and print the objects. Also define a method distance to calculate the
distance between any two point objects.
Write a function that prints a dictionary where the keys are numbers between 1 and 5
and the values are cubes of the keys.
Consider a tuple t1=(1, 2, 5, 7, 9, 2, 4, 6, 8, 10). WAP to perform following operations:
Print half the values of the tuple in one line and the other half in the next line.
Print another tuple whose values are even numbers in the given tuple.