cs
cs
Mangalam World
School, Gr. Noida
Topic - CBSE Practical File
Roll no. : - 26
Certificate
This is to certify that Yuvraj Singh of class XI-A Has successfully
completed the practical file of the subject Computer science laid down
in the regulations of CBSE for the purpose of Practical Examination
in Class XI, K.R. MANGALAM WORLD SCHOOL in the
academic year 2024-25.
TEACHER IN-CHARGE
PGT(Computer Science)
EXAMINER PRINCIPAL
Signature: Signature:
Date: Date:
Acknowledgement
Thank you
Question 1
Answer 1
print()
print(Wel)
Question 2
Answer 2
if x > y :
else :
if x < y :
else :
Answer 3
else :
else :
(i)
ns.
n=5
for j in range(i):
print('*', end='')
print()
(ii)
Answer
i=5
while i > 0:
i -= 1
(iii)
Answer
i=1
string = "ABCDE"
print(string[:i])
i += 1
Question 5
Write a program to input the value of x and n and print the sum of the following series:
i)
Answer
sum_series = 0
i=0
while i <= n:
sum_series += x ** i
i += 1
ii)
Answer
sum_series = 0
i=0
while i <= n:
sum_series += ((-1) ** i) * (x ** i)
i += 1
print("Sum of the series (1 - x + x^2 - x^3 + ... + (-1)^n * x^n) is:", sum_series)
iii)
Answer
sum_series = 0
i=1
while i <= n:
sum_series += (x ** i) / i
i += 1
Question 7
Answer
if n < 2 :
else :
if n % i == 0:
Question 8
Answer
n1, n2 = 0, 1
count = 0
if nterms <= 0:
elif nterms == 1:
print(n1)
else:
print("Fibonacci sequence:")
print(n1)
nth = n1 + n2
n1 = n2
n2 = nth
count += 1
Question 9
Compute the greatest common divisor and least common multiple of two integers.
Answer
i=1
gcd = i
i=i+1
greater = num1
else:
greater = num2
while(True):
lcm = greater
break
greater += 1
Question 10
Count and display the number of vowels, consonants, uppercase, lowercase characters
in string.
Answer
vowel_count=0
consonants_count=0
vowel = set("aeiouAEIOU")
if alphabet in vowel:
vowel_count=vowel_count +1
consonants_count=consonants_count
else:
consonants_count=consonants_count+1
uppercase_count=0
lowercase_count=0
uppercase_count += 1
elif elem.islower():
lowercase_count += 1
Question 11
Input a string and determine whether it is a palindrome or not; convert the case of
characters in a string.
Answer
if (s==s[::-1]):
else:
Question 12
Answer
mx = max(val)
mn = min(val)
Question 13
Input a list of numbers and swap elements at the even location with the elements at the
odd location.
Answer
s=len(val)
if s % 2!=0:
s=s-1
print(i,i+1)
val[i],val[i+1]=val[i+1],val[i]
Answer
mylist = []
for i in range(5):
value = int(input())
mylist.append(value)
element = int(input())
for i in range(5):
if element == mylist[i]: