0% found this document useful (0 votes)
448 views

Yash Practical File Class 12 Computer Science

This document contains a student's name, class, school, and subject details. It also contains questions related to Python programming concepts like functions, modules, recursion, and file handling. The student is asked to write Python code to answer questions on finding the greatest of two numbers, calculating a factorial, defining functions for power and Fibonacci series, creating a module for basic math operations, writing a recursive factorial function, taking user input and storing it in a file, counting vowels in a file, and creating a menu-driven program to calculate geometric shapes' areas and perimeters.

Uploaded by

rahul kumar jha
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
448 views

Yash Practical File Class 12 Computer Science

This document contains a student's name, class, school, and subject details. It also contains questions related to Python programming concepts like functions, modules, recursion, and file handling. The student is asked to write Python code to answer questions on finding the greatest of two numbers, calculating a factorial, defining functions for power and Fibonacci series, creating a module for basic math operations, writing a recursive factorial function, taking user input and storing it in a file, counting vowels in a file, and creating a menu-driven program to calculate geometric shapes' areas and perimeters.

Uploaded by

rahul kumar jha
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 20

NAME= YASH CHANDRA

CLASS= XII- B
SUBJECT= COMPUTER SCIENCE
SCHOOL= KV,SECTOR-3,ROHINI
ROLL NO=

UNDER THE GUIDANCE OF MRS.


NEELIMA SINGH MAM.
OUTPUT:
REVIEW OF PYTHON
Q1: Write a program in python to enter
numbers and find the greatest of the 2?
ANS:
OUTPUT:
Q2: Write a program in python to enter a
number and print its factorial?
ANS:
OUTPUT:
FUNCTIONS
Q1:Write a function which takes 2 parameters
and gives the result as power of values?
ANS:
OUTPUT:
Q2:Write a function to find Fibonacci series
upto n number of times where n is given as a
parameter to the function?
ANS:
Output:
Q3:MAKE A MODULE WHICH CONTAINS SUM AND
SUBTRACTION OF 2 NUMBERS?
ANS:
Output:
Q4: write a recursive function to calcula-
Te the factorial of a number.
Ans:
Output:
Data file handling
Q1: take the data from the user and store
it in a file “sample.txt”?
Ans:
Output:
Q2:write a program to check the total
number of vowels in the file “sample.txt”?
Ans:
Output:
Q3: create a menu driven program for the
area of circle ,circumference of circle
,area of rectangle and perimeter of the
rectangle?
Ans:

You might also like