Given two integers a and b, your task is to calculate and print the following four values:-
a+b
a-b
a*b
a/b using python
Take two matrices a,b of dimensions m*n, set values to the matrices
Create functions to add matrices and return thr result
Write a program to calculate the sum of the following series:
1 + 1/2 + 1/3 + 1/4 + 1/5 + 1/6 + 1/7 + ... + 1/20
Write a program that reads an integer and determines and prints whether it is odd or
even.
a) first the program using if statements
b) then the program using if/else statements
Write a program that reads in five integers and determines and prints the largest and
the smallest integers in the group. Use only the programming techniques you learned
up to now.
Write a program that reads in the radius of a circle and prints the circle's diameter,
circumference, and area. Use the constant value 3.14159 for p. Do all calculations in
output statements.
Family List:
A list of words is called the Family if the words in the list follow the following rule.
we should be able to obtain each word in the list by
-changing exactly one letter from the previous word in the list
-or , by adding exactly one letter to the previous word in the list
-or ,by removing exactly one letter from the previous word in the list
Given a list of words ,determine if the list is a Family or Not a Family
input:
The first line of input is an integer T representing the number of test cases
the first line of each test case has an integer N representing the total number of words
The second line contains N space separated strings
INPUT:
3
3
hip hop top
3
hip top hop
4
teat treat greet meet
output:
family
not a family
not a family
i/p:
3
3
tic tac toe
2
tic tac
3
tet treat greet
o/p:
not a family
family
not a family
You are on the top floor of a multiplex complex and want to go the ground floor,The lift is not working so you have to search for the staircase on each floor and go down to the exit.
As you are new to that multiplex,you have taken the floor map.you are given a map. M of building in a 2D matrix.
. All walkable space are represented by a 0
. Staircases are represented by a 1
.your starting position is represented by 2 and can be at any level of the car park
.Exit is always at the bottom right of the ground floor
. you must use the staircases 1 s to go down a level
.Each floor will have only one staircase apart from the ground floor which will not have any staircases.find the quickest route of the multiplex complex
input:the first line of input contains two space separated integer N representing the number of rows and C representing the number of columns
the next N lines contain C space-separated integers
I/P: 3 3
1 0 2
0 1 0
0 0 0
O/P:L2 D1 R1 D1 R1
Write a program that will accept five (5) grades. Use an array in
storing the five (5) grades. Calculate the average of five (5) grades and
determine the remark of the average if PASSED or FAILED. Write a
function in accepting the five (5) grades, function in calculating the
average of the five (5) grades and a function in determining the remark of
the average.
Family List:
A list of words is called the Family if the words in the list follow the following rule.
we should be able to obtain each word in the list by
-changing exactly one letter from the previous word in the list
-or , by adding exactly one letter to the previous word in the list
-or ,by removing exactly one letter from the previous word in the list
Given a list of words ,determine if the list is a Family or Not a Family
input:
The first line of input is an integer T representing the number of test cases
the first line of each test case has an integer N representing the total number of words
The second line contains N space separated strings