├── single3.py ├── .idea ├── .gitignore ├── vcs.xml ├── misc.xml ├── inspectionProfiles │ └── profiles_settings.xml ├── modules.xml └── PFSD.iml ├── single2.py ├── single1.py ├── re1.py ├── random1.py ├── main.py ├── DateAndTime.py └── Super.py /single3.py: -------------------------------------------------------------------------------- 1 | class S: 2 | def square(self,r): 3 | print(r*r) -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | -------------------------------------------------------------------------------- /single2.py: -------------------------------------------------------------------------------- 1 | class C: 2 | def circle(self,r): 3 | print(3.14*r*r) 4 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /single1.py: -------------------------------------------------------------------------------- 1 | from single2 import C 2 | from single3 import S 3 | class Parent(C,S): 4 | def function(self): 5 | print("hello") 6 | y=Parent() 7 | y.function() 8 | y.circle(int(input())) 9 | y.square(int(input())) -------------------------------------------------------------------------------- /.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /re1.py: -------------------------------------------------------------------------------- 1 | import re 2 | str1 = "i'm prince kumawat" 3 | matches1 = re.findall("prince",str1) 4 | print(matches1) 5 | matches2 = re.findall("i'm",str1) 6 | print(matches2) 7 | matches3 = re.findall("Pri",str1) 8 | print(matches3) 9 | matches4 = re.findall("kumawat",str1) 10 | print(matches4) -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /random1.py: -------------------------------------------------------------------------------- 1 | import random 2 | n=random.randbytes(3) 3 | print(n) 4 | print(random.randrange(1,8)) 5 | print(random.randint(100,200)) 6 | mylist=["jadu","aswh","virat","mahi"] 7 | mylist1={"jadu","aswh","viru","mahi"} 8 | print(random.choice(mylist)) 9 | print(random.choice(mylist1)) 10 | random.shuffle(mylist) 11 | print(mylist) -------------------------------------------------------------------------------- /.idea/PFSD.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | # This is a sample Python script. 2 | 3 | # Press Shift+F10 to execute it or replace it with your code. 4 | # Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings. 5 | 6 | 7 | def print_hi(name): 8 | # Use a breakpoint in the code line below to debug your script. 9 | print(f'Hi, {name}') # Press Ctrl+F8 to toggle the breakpoint. 10 | 11 | 12 | # Press the green button in the gutter to run the script. 13 | if __name__ == '__main__': 14 | print_hi('PyCharm') 15 | 16 | # See PyCharm help at https://www.jetbrains.com/help/pycharm/ 17 | -------------------------------------------------------------------------------- /DateAndTime.py: -------------------------------------------------------------------------------- 1 | import time 2 | print(time.asctime()) 3 | import datetime 4 | print(time.asctime(time.localtime(time.time()))) 5 | datetime_object = datetime.datetime.now() 6 | print(datetime_object) 7 | print("year:", datetime_object.year) 8 | print("month:", datetime_object.month) 9 | print("date:", datetime_object.date) 10 | print("hour:", datetime_object.hour) 11 | print("minute:", datetime_object.minute) 12 | import calendar 13 | s = calendar.prcal(2022) 14 | print(s) 15 | count=5 16 | def some(): 17 | global count 18 | count=count+1 19 | local=10 20 | print(count) 21 | print(local) 22 | some() -------------------------------------------------------------------------------- /Super.py: -------------------------------------------------------------------------------- 1 | class A: 2 | def __init__(self): 3 | print('Intializing: class A') 4 | def sub_method(self, b): 5 | print('Printing from A:',b) 6 | class B(A): 7 | def __init__(self): 8 | print('Intializing: class B') 9 | super().__init__() 10 | def sub_method(self, b): 11 | print('Printing from class B:', b) 12 | class C(B): 13 | def __init__(self): 14 | print('Intializing: class C') 15 | super().__init__() 16 | def sub_method(self, b): 17 | print('Printing from class C:', b) 18 | super().sub_method(b+1) 19 | y=C() 20 | y.sub_method(5) --------------------------------------------------------------------------------