Assignment On Python 2 Basics-1. Write A Function That Returns The Maximum of Two Numbers

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 11

ASSIGNMENT ON PYTHON 2

BASICS-

1. Write a function that returns the maximum of two numbers.

2. Write a function called fizz_buzz that takes a number.


3.Write a function called show Numbers that takes a parameter called limit. 

4.Given 2 strings, s1 and s2, create a new string by appending s2 in the middle of s1
5. Arrange String characters such that lowercase letters should come first

6. Given a string input Count all lower case, upper case, digits, and special symbols
7. Find all occurrences of “USA” in given string ignoring the case

8. Given a string, return the sum and average of the digits that appear in the string, ignoring all

other characters
9. Given a string of odd length greater 7, return a string made of the middle three chars of a given

String
10. Given an input string, count occurrences of all characters within a string

NUMPY AND PANDA AND MATPLOTLIB

1. Create a 4X2 integer array and Prints its attributes


2. Create a 5X2 integer array from a range between 100 to 200 such that the difference between

each element is 10

3. Following is the provided numPy array. return array of items in the third column from all rows
4. Following is the given numpy array return array of odd rows and even columns
5. Add the following two NumPy arrays and Modify a result array by calculating the square root

of each element

6. Split the array into four equal-sized sub-arrays


7. Following is the 2-D array. Print max from axis 0 and min from axis 1

8.Following is the input NumPy array delete column two and insert following new column in its

place.
9. Create a two 2-D array and Plot it using matplotlib

10. From any given data set print first and last five rows

You might also like