Computer Science IP Report
Computer Science IP Report
VIDYASHRAM
SSCE 2024-25
PROJECT TITLE:
NAME :
ROLL NO :
GRADE : XI-‘A’
SUBJECT : COMPUTER SCIENCE
TABLE OF CONTENTS:
S.NO TOPICS PG.NO
1. INTRODUCTION 1
7. BIBLIOGRAPHY 7
INTRODUCTION:
This course is the first of a two-course sequence: Introduction to
Computer Science and Programming Using Python, and Introduction
to Computational Thinking and Data Science. Together, they are
designed to help people with no prior exposure to computer science or
programming learn to think computationally and write programs to
tackle useful problems. Some of the people taking the two courses
will use them as a stepping stone to more advanced computer science
courses, but for many it will be their first and last computer science
courses. This run features lecture videos, lecture exercises, and
problem sets using Python 3.5. Even if you previously took the course
with Python 2.7, you will be able to easily transition to Python 3.5 in
future courses, or enroll now to refresh your learning.
Since these courses may be the only formal computer science courses
many of the students take, we have chosen to focus on breadth rather
than depth. The goal is to provide students with a brief introduction to
many topics so they will have an idea of what is possible when they
need to think about how to use computation to accomplish some goal
later in their career. That said, they are not "computation appreciation"
courses. They are challenging and rigorous courses in which the
students spend a lot of time and effort learning to bend the computer
to their will.
1
PROGRAM TO ACCEPT THE HEIGHT IN
CM AND CONVERT IT INTO FEET AND
INCHES
SOURCE CODE:
a=float(input('Enter your height in centimeters:'))
Feet=a*0.032
Inch=a*0.393
print('Your height in feet is:', Feet)
print('Your height in inch is:', Inch)
EXECUTION
Press F5 or Press Run Run Module
OUTPUT:
Enter your height in centimeters:177
Your height in feet is: 5.664
Your height in inch is: 69.561
2
PROGRAM THAT ACCEPTS WEIGHT IN
KG AND HEIGHT IN METERS AND
CALCULATE THE BMI
SOURCE CODE:
W = float(input('Enter the weight in Kg:'))
H = float(input('Enter height in meters:'))
BMI=W/(H**2)
print('BMI is:', BMI)
EXECUTION
Press F5 or Press Run Run Module
OUTPUT:
Enter the weight in Kg:70
Enter height in meters:1.8
BMI is: 21.604938271604937
3
PROGRAM THAT READS A STRING AND
THEN PRINTS A STRING THAT
CAPITALIZES EVERY OTHER LETTER IN
THE STRING
SOURCE CODE:
string=input('Enter a string: ')
length=len(string)
print('Original string:',string)
string2=''
for a in range(0,length,2):
string2+=string[a]
if a<length-1:
string2+=string[a+1].upper()
print('Alternatively capitalized string:',string2)
EXECUTION
Press F5 or Press Run Run Module
OUTPUT:
Enter a string: football
Original string: football
Alternatively capitalized string: fOoTbAlL
4
PYTHON SCRIPT THAT DISPLAYS THE
FIRST FIVE MERSENNE NUMBERS AND
DISPLAYS ‘PRIME’ NEXT TO MERSENNE
PRIME NUMBERS
SOURCE CODE:
for a in range(1,6):
mersnum=2**a-1
mid=mersnum//2+1
for b in range(2,mid):
if mersnum%b==0:
print(mersnum)
break
else:
print(mersnum,'\tPrime')
EXECUTION
Press F5 or Press Run Run Module
OUTPUT:
1 Prime
3 Prime
7 Prime
15
31 Prime
5
PROGRAM TO PRINT WHETHER A GIVEN
CHARACTER IS AN UPPERCASE OR A
LOWERCASE CHARACTER OR A DIGIT
OR ANY OTHER CHARACTER
SORCE CODE:
ch=input('Enter a single character: ')
if ch>='A'and ch<='Z':
print('You have entered an uppercase character.')
elif ch>='a'and ch<='z':
print('You have entered an lowercase character.')
elif ch>='0'and ch<='9':
print('You have entered a digit.')
else:
print('You have entered a special character.')
EXECUTION
Press F5 or Press Run Run Module
OUTPUT:
Enter a single character: I
You have entered an uppercase character.
6
BIBLIOGRAPHY
2. www.learnpython4cbse.com
3. www.geeksforgeeks.org
4. www.programiz.com