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
Consider the following schedule of transactions
R1(A) W1(A) R2(A) W2(B) W1(B) Commit1 Commit2
Which of the following properties are true for the above schedule and justify the reason for your answer
with explanation?
a) Conflict Serializable
b) View Serializable
c) Recoverable
Create an external CSS file for this form. This CSS file should select the font size of 20 points for all the labels; font colour should be dark blue for the headings and black for normal text. The background colour of the form should be light yellow.
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.
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 2RUN 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)
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)
(Only use if-else and nested if else in program)
Write a program which asks the user to open a bank account either Current or Savings. Your program will
display the following menu at the start:
Press 1 for Current Account
Press 2 for Savings Account
On the selection of account type, the user will open an account by providing an initial amount. In current account the initial amount for opening an account would be 2000 and for savings it would be 5000. After choosing the account type and opening the account with initial amount, your program will display the
following menu:
Press a for Deposit the money
Press b for withdrawing the money
In current account the user cannot withdraw more than 10000 rupees. In Savings account the user cannot withdraw more than 25000. When the user withdraws amount make sure that amount should not be more than the balance in account and at the end of withdrawal transaction, there should be
minimum of 500 rupees for each account.