Design a 'book' class with title, author,publisher, price and author's royalty as instance variables. Provide getter and setter properties for all variables. Also define a method royalty() to calculate royalty amount author can expect to receive the following royalties :10% of the retail price on the first 500 copies ;12.5% for the next, 1000 copies sold, then 15% for all further other copies sold.
Then design a new 'ebook' class inherited from 'book'class.Add ebook format (EPUB, PDF, MOBI etc) and additional instance variable in inherited class.
override method to deduct GST @12% on ebooks
Write a function in this file called nine_lines that uses the function three_lines (provided below) to print a total of nine lines.
Now add a function named clear_screen that uses a combination of the functions nine_lines, three_lines, and new_line (provided below) to print a total of twenty-five lines. The last line of your program should call first nine_lines and then the clear_screen function.
The function three_lines and new_line are defined below so that you can see nested function calls. Also, to make counting “blank” lines visually easier, the print command inside new_line will print a dot at the beginning of the line:
def new_line():
print('.')
def three_lines():
new_line()
new_line()
new_line()
Write a function in this file called nine_lines that uses the function three_lines (provided below) to print a total of nine lines.
Now add a function named clear_screen that uses a combination of the functions nine_lines, three_lines, and new_line (provided below) to print a total of twenty-five lines. The last line of your program should call first nine_lines and then the clear_screen function.
The function three_lines and new_line are defined below so that you can see nested function calls. Also, to make counting “blank” lines visually easier, the print command inside new_line will print a dot at the beginning of the line:
def new_line():
print('.')
def three_lines():
new_line()
new_line()
new_line()
Write a python function Find_Status(A) (Refer RollNo_W8A_3.py ) which takes a list of person’s age as input return a list containing person life status whether they will remain alive or not based in above conditions.
You are given number stored in variable with the name number multiply the number stored in the variable by 50 and print the result obtained.
INPUT is the first and the only line of the input contains the number stored in the variable
Constraints 1<=N=> 20
list of lists that has the first number as the same number given in the input list and the second number be the square of the first number.
write a python function Square_List(A) that takes a list as an input and returns another list of lists that has the first number as the same number given in the input list and the second number be the square of the first number.[[1, 1], [2, 4], [5, 25], [6, 36]]
Let A=[4, 5, 6, 5, 3, 2, 8, 0, 4, 6, 7, 8, 4, 5, 8, 9, 8, 6, 8, 5, 5, 4, 2, 1, 9, 3, 3, 4, 6, 4] be a list. You need to write a python function Create_List(A) to create a new two-dimensional list B=[[ , ], [ , ], ...., [ , ]] such that for an element [x, y] in B, x denote a value of an element in A and y denotes how many times x appeared in list A. The function Create_List (A) will take list A as input and return list B as an output
NOTE:
Do not use the input() function for taking input from the keyboard. Specify the input in fixed form but function must be generalized that can work with values.
you are not allowed to use extra lists other than A and B. Further, no predefined functions are allowed except len(), and append().
The volume of a sphere is 4/3πr3, where π has the value of "pi" given in Section 2.1 of your textbook. Write a function called print_volume (r) that takes an argument for the radius of the sphere, and prints the volume of the sphere.
Call your print_volume function three times with different values for radius.
Include all of the following in your Learning Journal:
The code for your print_volume function.
The inputs and outputs to three calls of your print_volume.
Part 2
Write your own function that illustrates a feature that you learned in this unit. The function must take at least one argument. The function should be your own creation, not copied from any other source. Do not copy a function from your textbook or the Internet.
Include all of the following in your Learning Journal:
The code for the function that you invented.
The inputs and outputs to three calls of your invented function.
A description of what feature(s) your function illustrates.
Date format-2 expalin code sum getting error