in the example the given list of strings are raju ,plays,golf
the word plays has the maximum number of distinct letters so the output should be plays
sample input 1
raju plays golf
sample out put 1
plays
sample inpput 2
Drink four liters of water every day
sample output 2
liters
swap most frequent letter with least given a sentence, swap the occurrences of the most frequenti with the least frequent letter and vice-versa. submisdong note: • consider upper and lower case letters as different . if there are multiple letters with the same frequency, choose the lower case letter that comes earliest in dictionary order o if letters like x and b have same frequency consider x o if letters like x and b have same frequency consider b
You are given a space separated list of integers as input, write a program to replace all non positive numbers in a list with the last positive number encountered
Column Title
You are given a number that denotes a column in the Excel Sheet, write a program to calculate the column name in the Excel Sheet. The naming of columns in the Excel Sheet is as follows
Column Name Column Number
A 1
B 2
C 3
... ...
X 24
Y 25
Z 26
AA 27
AB 28
... ...
BA 53
... ...
ZZ 702
AAA 703
... ...
Input
The first line of input is a positive integer.
Output
The output should be a single line containing the column name.
Explanation
For example, if the given column number is 42.
The column names with single alphabets end at 26. Further column names will contain two alphabets.
Therefore, for the column number 42, the first alphabet in the column name is A and the remaining number is (42-26) is 16.
The second alphabet of the column name is the 16th alphabet, which is P.
So, the output should be AP.
Suppose there is class of 30 students who have attendance between 40- 100%. The university has decided to give the bonus attendance between for those students who have the attendance between 70-74% to make it 75%. Identify the students those have attendance after adding the bonus attendance. Suppose students have its Roll_no & attendance. Add the bonus attendance to the obtained final attendance of student through array. Use functions to solve this tasks.
Input Format -The input should contain a roll_no, and attendance of 25 students.
Output Format-For each test case, display the roll_no and increased attendance of those students only who lies between the obtained attendance of 70-74%.
Yup are given a space separated list of integers as input,write a program to replace all non positive numbers in a list with the last positive number encountered
Given some space separated list of integers every element appears twice other than one element write a program to find the element which appeared only once
Write a fruitful function sum_to(n) that returns the sum of all integer numbers up to and
including n. So sum_to(10) would be 1+2+3. . . +10 which would return the value 55.
I want very simple code
Write a program that reads a string and returns a table of the letters of the alphabet in
alphabetical order which occur in the string together with the number of times each letter
occurs. Case should be ignored. A sample output of the program when the user enters the data
“ThiS is String with Upper and lower case Letters”, would look this this:
a 2
c 1
d 1
e 5
g 1
h 2
i 4
l 2
n 2
o 1
p 2
r 4
s 5
t 5
u 1
w 2
RUN THIS CODE AND TAKE A PHOTOS OF THE CODES AND THE OUTPUT. SHOW IT TO ME THE PHOTOS.
main_list = []
x = {}
field_names = [ "City name", "Area", "Population", "Annual Rainfall"]
list1 = [
["Adelaide", 1295, 1158259, 600.5],
["Brisbane", 5905, 1857594, 1146.4],
[ "Darwin", 112, 120900, 1714.7],
["Hobart", 135, 20556, 619.5],
["Sydney", 2058, 4336374, 1214.8],
["Melbourne", 1566, 3806092, 646.9],
["Perth", 5386, 1554769, 869.4]
]
for i in range(0, len(list1)):
for key in field_names:
for value in list1[i]:
x[key] = value
list1[i].remove(value)
break
main_list.append(x)
print(main_list)