Achyut 13490 Assignment 2 Sec Programming Using Python
Achyut 13490 Assignment 2 Sec Programming Using Python
— INPUT
OUTPUT
— INPUT
OUTPUT
—INPUT
OUTPUT
—INPUT
OUTPUT
5. Write A Program to check if a no is positive, negative or zero.
—INPUT
OUTPUT
6. Write A Program to find ASCII values of a character.
—INPUT
OUTPUT
7. Write A Program to find the area of a square, triangle, rectangle and circle.
— INPUT
OUTPUT
8. Write A Program to check if it’s a leap year or not.
— INPUT
OUTPUT
— INPUT
OUTPUT
— INPUT
OUTPUT
11. Write A Program to find all prime numbers within a range.
— INPUT
OUTPUT
12. Write A Program to take a single digit number from the keyboard and print its value in English word?
— INPUT
OUTPUT
13. Write A Program to check for the Armstrong number {407,157} 407= 4^3+0^3+7^3=
64+0+349=407}
— INPUT
OUTPUT
14. Write A Program to check for the Disarium number. {175= 1^1 + 7^2+ 5^3= 1+49+125=175}
— INPUT
OUTPUT
— INPUT
OUTPUT
16. Write A Program to use break, continue and pass statements.
— INPUT
OUTPUT
17. Write A Program to check greatest/smallest of the three numbers.
— INPUT
OUTPUT
18. Write A Program to check 2nd greatest/smallest of the three numbers.
— INPUT
OUTPUT
— INPUT
OUTPUT
— INPUT
OUTPUT
— INPUT
OUTPUT
22. Write A Program to find the sum of natural no/ odd no/ even no.
— INPUT
OUTPUT
23. Write A Program to get the cube of sum of n natural no’s.
— INPUT
OUTPUT
— INPUT
OUTPUT
— INPUT
OUTPUT
26. Write A Program to print all Possible Combinations from any three digit number.
— INPUT
OUTPUT
OUTPUT
— INPUT
OUTPUT
29. Write A Program to sort alphabets in a string. {dcabe will become abcde}
— INPUT
OUTPUT
30. Write A Program to sort elements in a list.
— INPUT
OUTPUT
31. Write A Program to swap adjacent letters in a string. {Eg: string will become tsirgn}
— INPUT
OUTPUT
— INPUT
OUTPUT
33. Write A Program to check and count any given specific letter in a string.
— INPUT
OUTPUT
34. Write A Program to accept any string which contains any of the vowels {a, e, I, o, u}.
— INPUT
OUTPUT
— INPUT
OUTPUT
— INPUT
OUTPUT
— INPUT
OUTPUT
38. Write A Program to add, subtract and multiply two matrices of a no.
— INPUT
OUTPUT
39. Write a Python program to count the number of strings where the string length is 2 or more and the
first and last character are the same from a given list of strings.
[ 'abc', 'xyz', 'aba', '1221' ] => 2
— INPUT
OUTPUT
OUTPUT
41. Write a Program that gets two lists as input and check if they have at least one common member.
[1, 2, 3, 4, 5] & [5, 6, 7, 8, 9] => {both have one no in common which is 5}
— INPUT
OUTPUT
42. Write A Program to Find the n-th term of series 1, 3, 6, 10, 15, 21…
— INPUT
OUTPUT
43. Write A Program to Find the N-th term of the Series 0, 2, 4, 8, 12, 18…
— INPUT
OUTPUT
44. Write A Program to print the table of any no in the below format
2*1=2
2*2=4
.
.
.
2 * 10 = 20
— INPUT
OUTPUT
— INPUT
OUTPUT
46.
*
**
***
****
— INPUT
OUTPUT
47.
****
***
**
*
— INPUT
OUTPUT
48.
––––*
–––**
––***
–****
*****
— INPUT
OUTPUT
49.
*
***
*****
*******
— INPUT
OUTPUT
50.
1
23
456
7 8 9 10
— INPUT
OUTPUT
51.
1
22
333
4444
55555
— INPUT
OUTPUT
52.
1
12
123
1234
12345
— INPUT
OUTPUT
53.
12345
1234
123
12
1
— INPUT
OUTPUT
54.
55555
4444
333
22
1
— INPUT
OUTPUT
55.
11111
2222
333
44
5
— INPUT
OUTPUT
56.
54321
5432
543
54
5
— INPUT
OUTPUT
57.
12345
–1234
––123
–––12
––––1
— INPUT
OUTPUT
58.
1
21
321
4321
54321
— INPUT
OUTPUT
59.
1
121
12321
1234321
— INPUT
OUTPUT
60.
0
12
234
3456
45678
— INPUT
OUTPUT
61.
––––1
–––12
––123
–1234
12345
— INPUT
OUTPUT
62.
12345
23456
34567
45678
56789
— INPUT
OUTPUT
63.
12345
12345
12345
12345
12345
— INPUT
OUTPUT
64.
54321
54321
54321
54321
54321
— INPUT
OUTPUT
65.
11111
22222
33333
44444
55555
— INPUT
OUTPUT
66.
55555
44444
33333
22222
11111
— INPUT
OUTPUT
67.
A
BB
CCC
DDDD
EEEEE
— INPUT
OUTPUT
68.
A
AB
ABC
ABCD
ABCDE
— INPUT
OUTPUT
69.
A
BC
DEF
GHIJ
KLMNO
— INPUT
OUTPUT
70.
ABCDE
ABCD
ABC
AB
A
— INPUT
OUTPUT
71.
EDCBA
EDCB
EDC
ED
E
— INPUT
OUTPUT