<jupyter_start><jupyter_text>Write a program to open/close file with read a paragraph from file and perform following tasks:     1.       Return the count of sub-string {pattern} appears in the given file    2.       Reverse Every Word of File     3.       Remove the {a,e,i,o,u} from the words of File Replace Every Character             a-z by z-a(reverse order, aàz, bày, …)<jupyter_code>def readline():
    print(file.readline())
def readlines():
    for i in file.readlines():
        print(i)
def write():
    file.write("\nNew line added\n")
def writes():
    file.writelines(['India is great\n','Jai Ho\n'])
file = open("test.txt","r+")

readline()
readlines()
write()
readlines()
writes()
readlines()
file = open("test.txt","r+")
temp = []
a=0
for i in file.readlines():
    temp.append(i.split('\n'))
    print(i[::-1])
# print("Substrings:",len(temp))<jupyter_output>dlroW olleH

elif omed si sihT

hahahah



dedda enil weN

taerg si aidnI
oH iaJ<jupyter_text>Create a Vehicle class without any variables and methods   2.       Create a Vehicle class with max_speed and mileage instance attributes   3.       Create a child class Bus that will inherit all of the variables and methods of the Vehicle class   4.       Create a Bus class that inherits from the Vehicle class.           Give the capacity argument of Bus.seating_capacity() a default value of 50.   5.       Define property that should have the same value for every class instance   6.       Create a Bus child class that inherits from the Vehicle class.           The default fare charge of any vehicle is seating capacity * 100.           If Vehicle is Bus instance, we need to add an extra 10% on full fare as a maintenance charge.           So total fare for bus instance will become the final amount = total fare + 10% of the total fare.   7.       Determine which class a given Bus object belongs to (Check type of an object)   8.       Determine if School_bus is also an instance of the Vehicle class.<jupyter_code>class Vehicle:
    def __init__(self,name,max_speed,mileage):
        self.name = name
        self.max_speed = max_speed
        self.mileage = mileage
    def seating_capacity(self,capacity):
        return f"Seating capacity of {self.name} is {capacity}"
    def fare(self,capacity):
        amount = capacity*100
        maintenance = amount/10
        total = amount+maintenance
        return f"Fare charge is Rs.{total}"
class Bus(Vehicle):
    def seating_capacity(self,capacity=48):
        return super().seating_capacity(capacity=48)
    def fare(self,capacity=48):
        return super().fare(capacity=48)

bus = Bus("Ashok Leyland",80,15)
print(f"Model {bus.name} with Top Speed of {bus.max_speed} and Mileage of {bus.mileage}")
print(bus.seating_capacity())
print(bus.fare())

class Bus(Vehicle):
    def seating_capacity(self,capacity=48):
        return super().seating_capacity(capacity=48)
    def 
bus = Bus("Ashok Leyland",80,15)
print(bus.seating_capacity())

class Car(Vehicle):
    pass
car = Car("<NAME>",160,17)
print(f"Model {car.name} with Top Speed of {car.max_speed} and Mileage of {car.mileage}")
print(type(bus))
print(isinstance(bus,Vehicle))<jupyter_output><class '__main__.Bus'>
True
{'fraction_non_alphanumeric': 0.10174237710018669, 'fraction_numerical': 0.015868077162414437, 'mean_word_length': 3.422283356258597, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '450877', 'license': 'WTFPL', 'n_tokens_mistral': 1013, 'n_tokens_neox': 970, 'n_words': 354, 'path': 'LDCE/String & OOPS.ipynb', 'repo_name': 'tanujdey7/Python', 'size': '3220'}