Index: Histogram Histogram ( (4, 9, 7) )
Index: Histogram Histogram ( (4, 9, 7) )
Index: Histogram Histogram ( (4, 9, 7) )
b. Enter the number from the user and depending on whether the number is even or odd,
print out an appropriate message to the user.
c. Write a program to generate the Fibonacci series.
d. Write a function that reverses the user defined value.
e. Write a function to check the input value is Armstrong and also write the function for
Palindrome.
f. Write a recursive function to print the factorial for a given number.
a. Write a function that takes a character (i.e. a string of length 1) and returns True if it is
a vowel, False otherwise.
b. Define a function that computes the length of a given list or string.
c. Define a procedure histogram() that takes a list of integers and prints a histogram to
the screen. For example, histogram([4, 9, 7]) should print the following:
****
*********
*******
a. A pangram is a sentence that contains all the letters of the English alphabet at least
once, for example: The quick brown fox jumps over the lazy dog. Your task here is to
write a function to check a sentence to see if it is a pangram or not.
b. Take a list, say for example this one: a = [1, 1, 2, 3, 5, 8, 13, 21, 34,
55, 89] and write a program that prints out all the elements of the list that are less
than 5.
a. Write a program that takes two lists and returns True if they have at least one common
member.
b. Write a Python program to print a specified list after removing the 0th, 2nd, 4th and 5th
elements.
1
c. Write a Python program to clone or copy a list
a. Design a class that store the information of student and display the same
b. Implement the concept of inheritance using python
c. Create a class called Numbers, which has a single class attribute called
MULTIPLIER, and a constructor which takes the parameters x and y (these should all be
numbers).
i. Write a method called add which returns the sum of the attributes x and y. ii. Write a
class method called multiply, which takes a single number parameter a and returns the
product of a and MULTIPLIER.
iii. Write a static method called subtract, which takes two number parameters, b and c,
and returns b - c.
iv. Write a method called value which returns a tuple containing the values of x and y.
Make this method into a property, and write a setter and a deleter for manipulating
the values of x and y.
8. Write the program for the following:
a. Open a new file in IDLE (“New Window” in the “File” menu) and save it as geometry.py
in the directory where you keep the files you create for this course. Then copy the functions
you wrote for calculating volumes and areas in the “Control Flow and Functions” exercise
into this file and save it.
Now open a new file and save it in the same directory. You should now be able to import
your own module like this:
import geometry
2
Try and add print dir(geometry) to the file and run it.
Now write a function pointyShapeVolume(x, y, squareBase) that calculates the volume of
a square pyramid if squareBase is True and of a right circular cone if squareBase is False.
x is the length of an edge on a square if squareBase is True and the radius of a circle when
squareBase is False. y is the height of the object. First use squareBase to distinguish the
cases. Use the circleArea and squareArea from the geometry module to calculate the base
areas.
b. Write a program to implement exception handling.
9. Write the program for the following:
a. Try to configure the widget with various options like: bg=”red”, family=”times”, size=18
b. Try to change the widget type and configuration options to experiment with other widget
types like Message, Button, Entry, Checkbutton, Radiobutton, Scale etc.
b. Design a database application to search the specified record from the database.
c. Design a database application to that allows the user to add, delete and modify the
records.
3
INDEX
List of Practical
Sign
Setting up CORDOVA, PhoneGAP Project and environment.
1. • Creating and building simple “Hello World” App using Cordova
• Adding and Using Buttons
• Adding and Using Event Listeners