Class 6 Ls 8 Notes
Class 6 Ls 8 Notes
Programs
PROGRAM-1
1. Write a program to find the product of two numbers x and y where x=150 and y=200
X=150
Y=200
Product = x*y
print (‘The product of two numbers is ‘,Product)
PROGRAM-2
2. It takes 3hours to drive a distance of 192km on a motor way, create a program to
calculate the average speed in km/h?
Time= 3
Dist=192
Speed = Dist / Time
print (‘Average speed is ‘, Speed , ‘km/h’)
PROGRAM-3
3. To calculate and print the circumference and area of a circle
# Circumference of circle is 2 π r
Radius = 25
Circumference = 2 * (22/7) * Radius
print (‘The circumference of circle is ‘ , Circumference)
PROGRAM-4
4. To input the roll number, name and marks in five subjects of a subject. Calculate the
total and percentage marks of the student.
rollno=101
name= 'John'
M1=80
M2=87
M3=83
M4=78
M5=76
Total=M1+M2+M3+M4+M5
percentage=Total / 5
print('percentage is =', percentage)
Class-6
Ls-8: INTRODUCING PYTHON
1. Write any four features of python programming language
Ans. Python is a high-level programming language. Some of the features of python are:
1. It is a platform -independent programming language
2. It has a simple syntax
3. Python is a case-sensitive language
4. It is an interpreted language
5. It is free to use and even free for commercial products.
5. What is the use of print() function ? discuss all the separators used with the print()
function
Ans. print() function is used to print a message or value on the output device.
Separators of print() function are:
1. ‘,' operator: when we use ',' operator, the values are displayed with a space between
them.
2. '\t'(tab space): when we use'\t' escape sequence, the values are displayed with a tab
space between them.
3. '\n'(New Line): it is used to end a line and start a new line