With the help panda library create a dataframe using the concept of
dictionary of lists where Keys and Values of dictionary take the data as
Write a function declaration for a function called grader that takes a numeric score and returns a letter grade. Grade has one argument of type integer. Use the rule that 90 to 100 is an A, 80 to 89 is a B, 70 to 79 is a C and less than 70 is an F.
In order to discourage excess consumption, an electric company charges its customers a lower rate, namely $0.11, for each of the first 250 kilowatt hours, and higher rate of $0.17 for each additional kilowatt hour. In addition, 10% surtax is added to the final bill. Write a program to calculate electric bills given the number of kilowatt hours consumed as input. Use two function declarations: one to compute the amount due without the surtax and one to compute the total due with surtax.
Write a program in python with the help of Pie chart display population of 3 states.
Consider a CSV file with some data and analyze data by using Pandas data frame and
functions.
Question 2
Write a Python program to check whether a given date is valid date or not and to out put the following.
• If the date is valid then the message “Date is Valid” otherwise the message “Date is Invalid”.
• If the date is a valid date, then the next date.
Hint: Follow the following steps.
(NOTE: You are not allowed to use any Python built-in functions.)
• Get the inputs Year, Month, and Date separately.
• Use selection statements, i.e., if-else statements to check if the Date, Month, and the Year are valid.
• if the date is a valid date, then print the next date (Increment the date).
Find latitude and longitude of first 20 countries with a population greater than or equal to the population limit given below. Use the country details from this dataset.
Your task is to find the sum of the length of all lines (in kms) that can be drawn between co-ordinates of these countries.
Please correct the errors in each problem. There are syntax errors, logical errors and runtime errors
1
x = 'hello'
y = ['hello']
if x == y(0):
print('Equal')
2
x = 'hello'
y = ['hello']
z = x + y
z.sort()
3
x = 'hello'
y = ['hello', 'goodbye']
print(x+y)
4
x = 'hello'
y = ['hello', 'goodbye']
print(x+y[1])
6.
def myfunction(x, y):
return x + y
myfunction(1)
7.
def myfunction(x, y):
return x + y
myfunction(x=1, 5)
8.
myList = [1, 5, 10]
print(myList[3])
9.
myList = list(range(0,10))
print(myList[0] + myList[10])
10.
myList = list(range(0,10))
for x in myList:
print(myList[x]/myList[x-1])
11.
for x list(range(0,10)):
print(x)
12.
def recurseMe(x, y):
return recurseMe(x-1 * y -1, x)
def main():
print(recurseMe(1,2))
main()
I would really appreciate your help!
Write an if/else statement that compares sold_yesterday and sold_today, and based upon that comparison assigns sales_trend the value -1 (the case where sold_yesterday is greater than sold_today) or 1.