RUN THIS CODE AND TAKE A PHOTOS OF THE CODES AND THE OUTPUT
class AddColumn:
def add_column(str1,list1):
dict1[str1].append(list1)
x=AddColumn()
x.add_column( "City name",["Adelaide", "Brisbane", "Darwin", "Hobart", "Sydney", "Melbourne", "Perth"])
x.add_column("Area", [1295,5905, 112, 1357, 2058, 1566, 5386])
x.add_column("Population", [1158259, 18557594, 120900, 205556, 4336374, 3306092, 1554769])
x.add_column("Annual Rainfall"[600.5, 1146.4, 1714.7, 619.5, 1214.8, 646.9,869.4])
print(dict1)
write a program to print the numbers in the increasing order along with their frequency.
Armstrong numbers between two intervals
Write a program to print all the Armstrong numbers in the given range
A to B(including A and B). An N-digit number is an Armstrong number if the number equals the sum of the Nth power of its digits.
Input
The first line has an integer
A. The second line has an integer B.
Output
Print all Armstrong numbers separated by a space.
If there are no Armstrong numbers in the given range, print
-1.
Explanation
For
A = 150 and B = 200
For example, if we take number 153, the sum of the cube of digits
1, 5, 3 is
13 + 53 + 33 = 153.
So, the output should be
153.
Sample Input 1
150
200
Sample Output 1
153
Sample Input 2
1
3
Sample Output 2
1 2 3
Sample Input 3
10
15
Sample Output 2
-1
Write a python program for read phone number
Write a python program for minimum absolute difference
Write a python program for replace negative numbers
Given an integer N, Write a program to print a pyramid of N rows as shown below.
In the example the number of rows in tbe pyramid is 5. So, the output shoyld be
. . . . 0 . . . .
. . . 0 0 0 . . .
. . 0 0 0 0 0 . .
. 0 0 0 0 0 0 0 .
0 0 0 0 0 0 0 0 0
Give the number of the month , write a program to print the name of the month
Input will be a single line Containing a integer N
Given a space-separted list of integers as input, write a program to add the elements in the given range and print their sum
You will be given M multiple range queries,where
You should print the sum of numbers that belong to the corresponding range
note: while checking if the number belongs to a range,including the string and numbers of range as well
Input
The first line of input is space-separated integers
The secondline of input is a positive integers M denoting the number of queries
The next M line contain two space-separated integer
Output:
The output should be M line printing the sum of each includes range
sample input 1:
1 2 2 3 3 3 4 5 6
2
0 2
1 4
sample output1:
5
18
sampleInput2:
6 6 14 20 8 -2 2 -3
4
1 2
2 5
3 6
0 4
sampleOutput:
2
2
12
2
Are Integers Created Equally?
by CodeChum Admin
It's time to find out if something is true or false. Let's test your capabilities by creating a program that checks if two integers are equal!
Instructions:
Input two integers in one line.
Print the two integers in one line, separate them with a space.
Print a string message on a new line, "Equal" if both integers are equal