1.Write a Python program to check whether a list contains a sublist.
a = [2,4,3,5,7] , b = [4,3]
Expected output: b is a sublist of a.
2.Write a Python program to reverse a tuple.
3.Write a Python program to find the repeated items of a tuple.
4. Write your own Python function “Sorting()” to sort any given sequence of numbers in ascending order. For example, if a user enters: 3, 13, 5, 9, 100, 32, 34, 5. Your function should output: 3, 5, 5, 9, 13, 32, 34, 100.
5. A complex number is a number of the form a + bi, whereby a and b are constants, and i is a special value that is defined as the square root of -1. Of course, you never try to actually calculate what the square root of -1 is, as that gives a runtime error; in complex numbers, you always let the i remain. For instance, the complex number 3 + 2i cannot be simplified any further. Addition of two complex numbers a + bi and c + di is defined as (a + c) + (b + d)i. Represent a complex number as a tuple of two numeric values, and create a function that calculates the addition of two complex numbers.
Create a list of restaurants (using tuples) near GWU:
â€¢ Restaurant name
â€¢ Review score
â€¢ Price (Using numbers such as 10, 20, 30, or $.)
Sort the restaurants based on the following rule:
â€¢ Review score (descending order) #1 Point
â€¢ Price (ascending order) # 1 Point
Do you need a similar assignment done for you from scratch? We have qualified writers to help you. We assure you an A+ quality paper that is free from plagiarism. Order now for an Amazing Discount! Use Discount Code “Newclient” for a 15% Discount!NB: We do not resell papers. Upon ordering, we do an original paper exclusively for you.
The post coding python appeared first on My Nursing Experts.