Write a program that prints the value of 120.456789 rounded to the nearest digit, tenth, hundredth, thousandth, and ten-thousandth. [Hint: This should make use of formatted output.].
Write a program that reads an integer and determines and prints whether it is odd or event. [Hint: Use the remainder operator. An even number is a multiple of two. Any multiple of two leaves a remainder of zero when divided by 2.].
Given the slope-intercept form equation, y = mx+b. Write a program that asks the user to enter values for the respective variables (m, x, and b). Use those variables to calculate the results of the equation. Then print out the values for m, x, b, and y.
Write a program that asks the user to enter two integers, obtains the numbers from the user, then prints the larger number followed by the words “is larger”. If the numbers are equal, print the message “These numbers are equal”.
Write a program that asks the user to enter two numbers, obtains the two numbers from the user, and prints out the sum, product, difference, quotient, and remainder of the two numbers.
Math Quiz
Riya took part in a maths quiz competition. To win the prize money she has to solve a tricky question at the end.For a given list of integers, write a program where all the integers in a given index range to be added.
She will be given M multiple ranges, where she should print the sum of numbers for each corresponding range.
Note: The limits in the range are both inclusive.
Input
The first line f input is space-separated integers.
The second line of input is a positive integer M denoting the number of index ranges.
The next M lines contain two space-separated integers of the range.
Output
The output should be M lines.
Each line contains an integer that represents the sum for the corresponding ranges.
Sample Input1
1 3 4 5 6
5
3 5
Sample Output1
12
[Please test the sample test cases and send the screenshots].
Lowest and Highest score
The teacher gave out the scores of the science quiz conducted last week and asked the ones with the lowest and highest scores to group up. Print the names of the students with minimum and maximum scores, respectively.
Note: In case of a tie, choose the name which comes first in the (dictionary order).
Sample Input1
2
shakti 24
disha 26
Sample Output1
shakti disha
Sample Input2
3
ajay 23
bijay 24
sanjay 23
Sample Output2
ajay bijay
Lowest and Highest score
The teacher gave out the scores of the science quiz conducted last week and asked the ones with the lowest and highest scores to group up. Print the names of the students with minimum and maximum scores, respectively.
Note: In case of a tie, choose the name which comes first in the (dictionary order).
Sample Input1
2
shakti 24
disha 26
Sample Output1
shakti disha
Sample Input2
3
ajay 23
bijay 24
sanjay 23
Sample Output2
ajay bijay
some tic values are divided into two parts . You have to combine these two parts into one tic string. Then, load the data into a dataframe
like this:
20141130 GIS 7713.1
20150228 GIS 6642.6
20150531 GIS 7607.7
19990630 GNT X 0.0000
19990930 GNT X 0.0000
19991231 GNT X 0.0000
20000331 GNT X 0.0000
20000630 GNT X 0.0000
The above is correct, the below converts to the above
1. Given: List1[‘Bob’, ‘Andy’, ‘Roy’, ‘Mike’, ‘Kim’]
print the first element