Create a Python script which will accept two positive integers and will display the COMMON DIVISORS.
I need the code to have an output.
in,a hotel they are 'n' rooms for odd rooms the bulb is on for even room bulb is off..
on is represented as 1
off is represented as 0
n = 5
output
1 0 1 0 1
0 1 0 1 0
1 0 1 0 1
0 1 0 1 0
1 0 1 0 1
n = 6
output
1 0 1 0 1 0
0 1 0 1 0 1
1 0 1 0 1 0
0 1 0 1 0 1
1 0 1 0 1 0
0 1 0 1 0 1
A
B B
C C
B B
A
can i get code for this please
hollow diamond using 2*n-1 rows and 2*n-1 columns
Sample Input 1
5
1
10
4
3
2
Sample Output 1
3
Sample Input 2
4
2
3
5
7
Sample Output 2
2
can i get exact code for this to print first prime number
arjun has two strings s and t he can do following operation at most once
You are given m*n matrix and k write a program to compute the area of submatrix
String encoding
A shifted to right by 1 b
If abc shifted to ijk according to input is yes other wise no
Write a function called Reverse that takes in a string value and returns the string with the characters in reverse. If the string reads the same forwards as it does backwards the function should output “[word] is a palindrome!”.
Ex:
Reverse(“apple”)
outputs elppa
Reverse(“racecar”)
outputs racescar is a palindrome!
Hint: Make sure you take in your input and then make it lower case using the .lower() method.
Define a function named "calAverage" which take a list of integers as parameter. This function will then calculate and store the average into a variable named "result". Finally, the function MUST return the result with 2 decimal place only. For Example given the following list, [2,6,8,3,4,6], the function will return 4.83 (float).
Define a function named "secondLarge" which take a list of numbers (integer) as parameter. This function will then identify and return the 2nd largest number in the list. The function will return smallest number if the parameter only contains two numbers. While the function will return the only number if the list contain only single number. On some odd case, the function will return -999 if the parameter contains other datatype i.e. string or floaat in the list.