Skip to content

python123-dev/numpy_pandas

Repository files navigation

numpy_pandas

https://machinelearningmastery.com/wp-content/uploads/2022/04/cheatsheet.png

iris = 'http://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data'

questions=https://docs.google.com/forms/d/e/1FAIpQLSeySGbGSAk_quIs7pkP-fEphURt8MUz9Ziz6yi58FtCCRluZQ/viewform?usp=sf_link

may-29-2024 python test - https://docs.google.com/document/d/1BteXGqjfn60F3loMl1953UCDn9GGXZ8z/edit?usp=sharing&ouid=114028356553080472739&rtpof=true&sd=true

PYTHON TEST MAY 2023

PART - 1

  1. Explain your understanding about OOPS?
  2. Pros and cons in OOPS?
  3. What is a class in Python? Explain with an example.
  4. How do you access class members?
  5. What is an object in Python? Explain with an example.
  6. What is inheritance in Python? Explain with an example.
  7. Draw the types of inheritance?
  8. How do you create a subclass in Python?
  9. What is polymorphism in Python? Explain with an example.
  10. How do you implement polymorphism in Python?
  11. What is encapsulation in Python? How do you implement it?
  12. How do you define an abstract class in Python?
  13. How will you create constructor in Python?
  14. Write a program using class to store name and marks of students in list and print total marks.
  15. Find the error in the following program to get the given output? class Fruits: def init(self, f1, f2): self.f1=f1 self.f2=f2 def display(self): print("Fruit 1 = %s, Fruit 2 = %s" %(self.f1, self.f2)) F = Fruits ('Apple', 'Mango') del F.display F.display()

Output: Fruit 1 = Apple, Fruit 2 = Mango

PART-2

String Manipulation

  1. Write a python program to find the length of a string. Without using len() function.
  2. What is string slicing explain with examples.
  3. Write a Python code snippet to check if a given substring is present in a given string. Input: ‘abcd’ Output: a,ab,abc,abcd b,bc,bcd c,cd d
  4. Built-in String functions. Explain any 5 with examples.
  5. Explain the code with output. What will be your output if you try these slicing operations. a. (str1[10:16]) b. (str1[10:16:4]) c. (str1[10:16:2]) d. (str1[::3]) Input: str1="Welcome to learn Python"
  6. Program that accept a string from the user and display the same after removing vowels from it?
  7. What will be the output of the given python program? str1 = "welcome" str2 = "to school" str3=str1[:2]+str2[len(str2)-2:] print(str3)
  8. Write a Python program to display the given pattern C O M P U T E R C O M P U T E C O M P U T C O M P U C O M P C O M C O C

List Manipulations

  1. What is a list in Python? Explain its purpose and how it differs from other data types.
  2. How do you create an empty list in Python? Provide an example.
  3. What is the difference between append() and extend() methods in Python lists? Explain with an example.
  4. Explain the concept of list comprehension in Python. Provide an example of list comprehension to filter even numbers from a given list.
  5. What are the built-in functions for manipulating lists in Python? Provide examples for at least three different built-in functions.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published