5937class XI
5937class XI
Syllabus: Overview, Elementary Concepts, IO, Operators, If-else, Loops, Strings, Boolean, Computer Mgt
and Operating systems.
A)
1. Give output: 2. Give output:
var1 = 'Hello World!' x=”abcdE”
print "Updated String :- ", var1[:6] + print(x.lower())
'Python'
B)
Write a statement in python for the following string:
St=”My City is the BEST”
• check if all the characters are alphabetic
• check if string ends with ‘T’
• check if it contains a digit
• check if it contains a Title Words
• check if it contains a spaces
5. Give output:
a=0
for t in range(10):
a=a+1
print(a)
1. Draw the circuit diagram of the following using basic gates: (x+y).(x+y’).(x’+y)
2. Draw the circuit diagram of the following using universal gates: (a+b’)(b+c’)
3. Write the equivalent equation/ expression of the following circuit diagram:
1. A prime number is a number which is having only two factors (a number with which it is divisible).
You have to write a program to accept a number. Add two to it and now check whether a newly
number generated is a prime number or not.
Eg: If input is 9. After adding 2 it is now 11. Check whether 11 is a prime number or not.
OR
Accept a number (“n”) and a choice (“ch”) from the user:
If ch is 1 then print all odd numbers from 1 till “n”
If ch is 2 then print all even numbers from 1 till “n”
The program should get executed like a menu driven program
2. A Fibonacci series of numbers in which each number ( Fibonacci number ) is the sum of
the two preceding numbers. You have to accept ‘n’ i.e. the limit till which a user can
generate all Fibonacci numbers till that number.
Eg: If user enters 8 then output will be: 0,1,1,2,3,5,8,13
3. The product of an integer and all the integers below it is a factorial; e.g. factorial four ( 4! )
is equal to 24. It may also be generated by multiplying all numbers from 1 till that number.
You have to write a program to check if a number entered is positive or not. If it is positive
then print the factorial of the number entered.
Eg: If user enters 3… It is a positive number so output should be 6 ie 1x2x3 or 3x2x1
__________________________