You are on page 1of 26

01. WAF to simulate a dice.

Call that function as many times as the user


wants.

Output:
02. WAF that calculates the interest rate for given principal, interest
rate and time in years.
all arguments should have default values.call the function many times
and observe when it takes deafault argument
and when it takes passed argument.

Output:
03. WAF that creates file "3.txt", takes five lines from the user and
stores them into a file.

Output:
Content of the File after Execution:
04. WAF that reads a file "3.txt" and counts the total number of vowels
and consonants it contains.

Content of the File before execution:

Output:
05. WAF called "findA" which finds lines starting with A or a in file
"3.txt" and writes them into "5.txt"

Contents of 3.txt:

Contents of 5.txt after execution:


06. WAF creates a binary file named "6.dat" which takes and stores
information of 5 students in the form of a dictionary.
The file should contain name roll no. and marks of students.
Output:
07. WAF that searches for specific roll no. in file "6.dat" , prints name
and roll no. of student if roll no. is found.
Prints appropriate messages otherwise.

Output:
Execution 1:

Execution 2:
Execution 3:
08. WAF that reads "6.dat" increases the marks of those students who have
scored 80 or above marks by 5.
Print the data before and after update.
Output:
09. WAF that creates a csv file "9.csv" and stores five usernames and
passwords entered by the user.
Program:
Output:

File Contents of 9.csv:


10. WAF that searches "9.csv" for a username entered by user. if found,
write his/her password and write appropriate message otherwise.
Program:
Output:
Execution 1:

Execution 2:

Execution 3:
11. Write names of a few students in a file "11.txt". WAF which randomly
gives the name of the student from the list.
Program:
Content of 11.txt file:

Output of the Program:


12. implement stack using a list.
Output:
13. WAF to print a fibonacci sequence until a certain number.
Output:
Execution 1:

Execution 2:

Execution 3:
14. WAF to find the factorial of a given number.
Program:

Execution 1:
15. WAF to check whether the given number is a prime number or not.

Output:
Execution 1:

You might also like