├── .gitignore
├── 10nov.py
├── 10th_oct.py
├── 11th_sept_home.py
├── 12_dec.py
├── 12th_oct_def.py
├── 13th_oct_local_global_variable.py
├── 14_nov.py
├── 15th_sept.py
├── 16th_nov.py
├── 17th_nov.py
├── 19th_sept.py
├── 1_sept.py
├── 1st_sept.py
├── 23rd_nov.py
├── 24th_nov.py
├── 2nd_nov.py
├── 3rd_oct.py
├── 3rd_sept_home.py
├── 6th_oct.py
├── 6th_oct_1.py
├── 7th_nov.py
├── 7th_sept.py
├── 7th_sept_1.py
├── 7th_sept_2.py
├── 7th_sept_3.py
├── 8th_sept.py
├── 8th_sept_1.py
├── 8th_sept_2.py
├── 9th_nov.py
├── LICENSE
├── NEW.py
├── README.md
├── dict_23_nov.py
├── dictionary.py
├── facto.py
├── factorail.py
├── first_class.py
├── gst.py
├── gst0.py
├── h.py
├── halu.py
├── haua.py
├── jj.py
├── k.py
├── list.py
├── list_functions.py
├── okkkk.py
├── practice_00.py
├── practice_01.py
├── prime_no.py
├── priyanshu.py
├── recursion.py
├── replace.py
├── rough.py
├── string_functions.py
├── tempCodeRunnerFile.py
├── test_cuarency.py
├── testing.py
├── try.py
├── tuples.py
└── tuples_functions.py
/.gitignore:
--------------------------------------------------------------------------------
1 | # Byte-compiled / optimized / DLL files
2 | __pycache__/
3 | *.py[cod]
4 | *$py.class
5 |
6 | # C extensions
7 | *.so
8 |
9 | # Distribution / packaging
10 | .Python
11 | build/
12 | develop-eggs/
13 | dist/
14 | downloads/
15 | eggs/
16 | .eggs/
17 | lib/
18 | lib64/
19 | parts/
20 | sdist/
21 | var/
22 | wheels/
23 | pip-wheel-metadata/
24 | share/python-wheels/
25 | *.egg-info/
26 | .installed.cfg
27 | *.egg
28 | MANIFEST
29 |
30 | # PyInstaller
31 | # Usually these files are written by a python script from a template
32 | # before PyInstaller builds the exe, so as to inject date/other infos into it.
33 | *.manifest
34 | *.spec
35 |
36 | # Installer logs
37 | pip-log.txt
38 | pip-delete-this-directory.txt
39 |
40 | # Unit test / coverage reports
41 | htmlcov/
42 | .tox/
43 | .nox/
44 | .coverage
45 | .coverage.*
46 | .cache
47 | nosetests.xml
48 | coverage.xml
49 | *.cover
50 | *.py,cover
51 | .hypothesis/
52 | .pytest_cache/
53 |
54 | # Translations
55 | *.mo
56 | *.pot
57 |
58 | # Django stuff:
59 | *.log
60 | local_settings.py
61 | db.sqlite3
62 | db.sqlite3-journal
63 |
64 | # Flask stuff:
65 | instance/
66 | .webassets-cache
67 |
68 | # Scrapy stuff:
69 | .scrapy
70 |
71 | # Sphinx documentation
72 | docs/_build/
73 |
74 | # PyBuilder
75 | target/
76 |
77 | # Jupyter Notebook
78 | .ipynb_checkpoints
79 |
80 | # IPython
81 | profile_default/
82 | ipython_config.py
83 |
84 | # pyenv
85 | .python-version
86 |
87 | # pipenv
88 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
89 | # However, in case of collaboration, if having platform-specific dependencies or dependencies
90 | # having no cross-platform support, pipenv may install dependencies that don't work, or not
91 | # install all needed dependencies.
92 | #Pipfile.lock
93 |
94 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow
95 | __pypackages__/
96 |
97 | # Celery stuff
98 | celerybeat-schedule
99 | celerybeat.pid
100 |
101 | # SageMath parsed files
102 | *.sage.py
103 |
104 | # Environments
105 | .env
106 | .venv
107 | env/
108 | venv/
109 | ENV/
110 | env.bak/
111 | venv.bak/
112 |
113 | # Spyder project settings
114 | .spyderproject
115 | .spyproject
116 |
117 | # Rope project settings
118 | .ropeproject
119 |
120 | # mkdocs documentation
121 | /site
122 |
123 | # mypy
124 | .mypy_cache/
125 | .dmypy.json
126 | dmypy.json
127 |
128 | # Pyre type checker
129 | .pyre/
130 |
--------------------------------------------------------------------------------
/10nov.py:
--------------------------------------------------------------------------------
1 | '''l1=[1,2,3,4]
2 | l2=[10,11,12,13]
3 | t=(66,63,34)
4 | s={123,1234,12345}
5 | d={"halua":"50","sabun":"60"}
6 | l1.extend(l2)
7 | l1.extend(t)
8 | l1.extend(s)
9 | l1.extend(d)
10 | l1.append(7)
11 | l1.insert(2,9)
12 | l1.pop(0)
13 | #l1.sort()
14 | print(l1)
15 | s="Alexander the great "
16 | l3=s.split()
17 | print(l3)
18 | '''
19 | l=[]
20 | a=int(input("enter the no. of list items : "))
21 | for i in range(0,a):
22 | m=int(input())
23 | l.append(m)
24 | print(l)
25 | def fun(l):
26 | for i in :
27 | x=0
28 | x.append(i)
29 | print(fun(i))
--------------------------------------------------------------------------------
/10th_oct.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ash-codes18/Python/b7bddc844d9d34e8524f2e39e13a15d814b6997c/10th_oct.py
--------------------------------------------------------------------------------
/11th_sept_home.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ash-codes18/Python/b7bddc844d9d34e8524f2e39e13a15d814b6997c/11th_sept_home.py
--------------------------------------------------------------------------------
/12_dec.py:
--------------------------------------------------------------------------------
1 | # class Employee:
2 | # pass
3 | # Emp1=Employee()
4 | # a=input("Enter the name of the Employee: ")
5 | # Emp1.name=a
6 | # Emp1.age=25
7 | # Emp1.salary=25000
8 | # print('Emp1.name:',Emp1.name)
9 | # print('Emp1.salary:',Emp1.salary)
10 |
11 | class Car:
12 | def setName(self,name):
13 | self.name=name
14 | def getName(self):
15 | return self.name
16 | Honda=Car()
17 | name=input("car name: ")
18 | Honda.setName(name)
19 | print("Honda car name: ", Honda.getName())
--------------------------------------------------------------------------------
/12th_oct_def.py:
--------------------------------------------------------------------------------
1 | '''def sum(x,y):
2 | s=0;
3 | for i in range(x,y+1):
4 | s=s+i;
5 | print("sum of intergers: ", s)
6 | sum(1,25)
7 | sum(50,75)
8 | sum(90,100)'''
9 |
10 | '''def halua(x,y):
11 | h=0;
12 | for i in range(x,y+1):
13 | h=i
14 | print("This no. is greater among the two: ", h)
15 | halua(435,5555)'''
16 |
17 | d=[]
18 | def sum(x,y):
19 | s=0
20 |
21 | for i in range(x,y+1):
22 | s=s+i
23 | print("sum of int:",s)
24 | d.append(s)
25 | d.sort()
26 | sum(1,25)
27 | sum(50,75)
28 | sum(45,56)
29 | print("greater",d[-1])
--------------------------------------------------------------------------------
/13th_oct_local_global_variable.py:
--------------------------------------------------------------------------------
1 | ''' Function:
2 | Local and global variable'''
3 | '''def sum():
4 | q=10
5 | print("the values of q", q)
6 | print("the values of p", p)
7 | sum()
8 | print("the value of p", p)
9 | p=20
10 | def sum():
11 | q=10
12 | print("the value of q", q)
13 | print("the value of p", p)
14 | sum'''
15 |
16 | #parameters with default values
17 |
18 | '''def msg(name="Harry!,", message="Welcome to LPU"):
19 | print("Hello", name, message)
20 | msg()'''
21 |
22 | #Keyword arguments
23 | '''def msg(Name, Age):
24 | print("Name =", Name,", " "Age =", Age)
25 | msg(Age=25,Name="Harry")'''
26 |
27 |
28 | '''def msg(name, message="Welcome to LPU"):
29 | print("Hello", name, message)
30 | msg("Harry!,")'''
31 | s=10
32 | def call():
33 | p=int(input())
34 | print((s+p)**p)
35 |
36 |
--------------------------------------------------------------------------------
/14_nov.py:
--------------------------------------------------------------------------------
1 | class college:
2 | def __init__(self,name,age):
3 | self.name = name
4 | self.age = age
5 | s1=college("ahhahahaha",88)
6 | print(s1.name)
7 | print(s1.age)
8 |
9 | # class student:
10 | # def stud(self):
11 | # self.name = input("Enter the name : ")
12 | # self.roll = int(input("Enter the roll no. : "))
13 | # self.percentage = float(input("Enter the percentage :"))
14 | # def display(self):
15 | # print("Name :",self.name)
16 | # print("roll no. :",self.roll)
17 | # print("Percentage :",self.percentage)
18 | # a=student()
19 | # a.stud()
20 | # a.display()
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/15th_sept.py:
--------------------------------------------------------------------------------
1 | '''m = int(input("Enter the number: "))
2 | for i in range(1,11,2):
3 | print(m,"*",i, "=", m*i)'''
4 |
5 | '''n=int(input("Enter the no. :"))
6 | for i in range(n):
7 | for j in range(n,i):
8 | print("*",end=" ")
9 | print("")'''
10 |
11 | n=eval(input("Enter the no.:"))
12 | for i in range(n):
13 | for j in range(n,i):
14 | for k in range(i,j):
15 | print("*",end="")
16 | print("")
17 | #get the half diamond pattern printed
18 |
--------------------------------------------------------------------------------
/16th_nov.py:
--------------------------------------------------------------------------------
1 | # class college:
2 | # def __init__(course,name,roll):
3 | # course.name = name #("halua")
4 | # course.roll = roll #("66")
5 | # a= college("halua","66")
6 | # print(a.name)
7 | # print(a.roll)
8 |
9 | '''class college:
10 | def __init__(self,f1,f2):
11 | self.f1 = f1
12 | self.f2 = f2
13 | def __str__(self):
14 | return f"{self.f1}{self.f2}"
15 | p=college("yash","55")
16 | print(p)'''
17 | '''class college:
18 | def __init__(self,f1,f2,f3,f4,f5,f6):
19 | self.f1 = f1
20 | self.f2 = f2
21 | self.f3 = f3
22 | self.f4 = f4
23 | self.f5 = f5
24 | self.f6 = f6
25 | def add(self):
26 | print("My name is "+self.f1,"My age is "+self.f2, sep="\n")
27 | print("My name is "+self.f3,"My age is "+self.f4, sep="\n")
28 | print("My name is "+self.f5,"My age is "+self.f6, sep="\n")
29 | p=college("Heena","28","meena","27","deeka","27")
30 | p.add()'''
31 |
32 | '''class college:
33 | def __str__(self,f1,f2):
34 | return f"{self.f1}{self.f2}"
35 | a=college("ash","99")
36 | print(a.f1)
37 | print(a.f2)'''
38 |
39 | # class college:
40 | # def __init__(self,f1,f2):
41 | # self.f1 = f1
42 | # self.f2 = f2
43 | # def __str__(self):
44 | # return f"{self.f1}{self.f2}"
45 | # p=college("yash","55")
46 | # del p.f1
47 | # print(p)
48 |
49 | class college:
50 | def __init__(self,f1,f2):
51 | self.f1 = f1
52 | self.f2 = f2
53 | def __str__(self):
54 | return f"{self.f1}{self.f2}"
55 | p=college("yash","55")
56 | print(p)
57 | del p.f1
58 | print(p.f2)
59 |
--------------------------------------------------------------------------------
/17th_nov.py:
--------------------------------------------------------------------------------
1 | class college:
2 | def __init__(self,f1,f2):
3 | self.f1=f1
4 | self.f2=f2
5 | def display(self):
6 | print(self.f1,self.f2)
7 | class div(college):
8 | pass
9 | x=div("Hakuna",5*25)
10 | x.display()
--------------------------------------------------------------------------------
/19th_sept.py:
--------------------------------------------------------------------------------
1 | L1=["Harry", A, "Manu", B, X6]
2 | S1=("halua", 5, "joginder",)
3 | T1={"habibi", "welcome", "to", "Dubai", "7", "8", "6"}
4 | print()
--------------------------------------------------------------------------------
/1_sept.py:
--------------------------------------------------------------------------------
1 | E=int(input(" enter the marks obtained in english :"))
2 | M=int(input("enter the marks obtained in maths :"))
3 | C=int(input("enter the marks obtained in chemistry :"))
4 | P=int(input ("enter the marks obtained in physics :"))
5 | CS=int(input("enter the marks obtained in computer science :"))
6 | PHE=int(input("enter the marks obtained in physical education :"))
7 | Total=E+M+P+CS+PHE+C
8 | print(Total)
9 | p= Total/600 * 100
10 | print(p)
11 | if p>=90:
12 | print("grade=A")
13 | elif p<90 or p>80:
14 | print("grade=B")
15 | elif p<80 or p>70:
16 | print("grade=C")
17 | elif p<70 or p>60:
18 | print("grade=D")
19 | else:
20 | print("FAIL")
21 |
22 |
--------------------------------------------------------------------------------
/1st_sept.py:
--------------------------------------------------------------------------------
1 | Day=int(input("enter the rank of day :"))
2 | if Day==1:
3 | print("Monday")
4 | elif Day==2:
5 | print("Tuesday")
6 | elif Day==3:
7 | print("Wednesday")
8 | elif Day==4:
9 | print("Thursday")
10 | elif Day==5:
11 | print("Friday")
12 | elif Day==6:
13 | print("Saturday")
14 | elif Day==7:
15 | print("Sunday")
--------------------------------------------------------------------------------
/23rd_nov.py:
--------------------------------------------------------------------------------
1 | # a={'a':1,'b':2,'c':2,'d':3}
2 | # b = {}
3 |
4 | # for x,y in a.items():
5 | # if y not in b.values():
6 | # b[x] = y
7 |
8 | # print(b)
9 |
10 |
11 | # a={'a':1,'b':2,'c':2,'d':3,'e':3}
12 | # b=frozenset(a)
13 | # print(b)
14 |
15 | x={}
16 |
--------------------------------------------------------------------------------
/24th_nov.py:
--------------------------------------------------------------------------------
1 | # d1=int(input())
2 | # d2=int(input())
3 | # dict3=[d1[i]:d2[i] for i in range(len(d2))]
4 | # print(dict3)
5 |
6 |
7 | x=int(input())
8 | y=int(input())
9 | z=int(input())
10 | print(list([b,c,d] for b in range(x+1) for c in range(y+1) for d in range(z+1) if (x+y+z!=3)))
--------------------------------------------------------------------------------
/2nd_nov.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ash-codes18/Python/b7bddc844d9d34e8524f2e39e13a15d814b6997c/2nd_nov.py
--------------------------------------------------------------------------------
/3rd_oct.py:
--------------------------------------------------------------------------------
1 | '''for i in range(1,100,1):
2 | if i==11:
3 | break
4 | else:
5 | print(i)'''
6 |
7 | num=int(input())
8 | x=num
9 | for i in range(2,num):
10 | if (num%i==0):
11 | flag=0
12 | break
13 | else:
14 | flag=1
15 | if (flag==1):
16 | print("prime")
17 | else:
18 | print("not prime")
19 |
--------------------------------------------------------------------------------
/3rd_sept_home.py:
--------------------------------------------------------------------------------
1 | from playsound import playsound
2 | playsound('C:\\Users\\Ashmit\\Downloads\\Telegram Desktop\\GAYLE - abcdefu.mp3')
--------------------------------------------------------------------------------
/6th_oct.py:
--------------------------------------------------------------------------------
1 | a=input("Enter the name of the person:")
2 | for i in a:
3 | if i==" ":
4 | continue
5 | print(i, end="")
--------------------------------------------------------------------------------
/6th_oct_1.py:
--------------------------------------------------------------------------------
1 | T=(int(input("enter range: ")))
2 | a=input("enter your string with space: ")
3 | b=input("enter your string without space: ")
4 | for i in range(T):
5 | if i==5:
6 | print(b)
7 | continue
8 | else:
9 | print(a)
--------------------------------------------------------------------------------
/7th_nov.py:
--------------------------------------------------------------------------------
1 |
2 |
3 | # a="Pythonprogramming"
4 | # b="pro786"
5 | # c="556"
6 | # print(a.isalpha())
7 | # print(b.isalnum())
8 | # print(c.isdigit())
9 | # x="ohohoho maja aa gaya bidu"
10 | # print(x.endswith("u"))
11 | # print(x.startswith("oh"))
12 | # print(x.find("m"))
13 | # print(x.count("o"))
14 | # print(x.rfind("a"))
15 |
16 |
17 |
18 | # y="hungama Kare kya"
19 | # print(y.capitalize())
20 | # print(y.lower())
21 | # print(y.upper())
22 | # print(y.swapcase())
23 | # print(y.replace("hungama", "halua"))
24 | # print(y.title())
25 |
26 |
27 | '''stripping'''
28 | # s=" Hello python o "
29 | # b=s.lstrip()
30 | # n=s.rstrip()
31 | # print("before lstrip:",s)
32 | # print("after lstrip:",s.lstrip())
33 | # print("before rstrip:",s)
34 | # print("after rstrip",s.rstrip())
35 | # print(s.strip(" o"))
36 | # print(len(s))
37 | # print(len(b))
38 | # print(len(n))
39 |
40 | # g="halua hai kya"
41 | # print(g.center(25))
42 | # print(g.ljust(10))
43 | # print(g.rjust(25))
44 |
45 | # def fun(word):
46 | # for i in word:
47 | # c=word.count(i)
48 | # if c>1:
49 | # print(i,c)
50 |
51 |
52 | # word=input()
53 | # fun(word)
54 |
55 |
56 | def countB(d):
57 | count=0
58 | for i in d:
59 | if (i==i):
60 | count.d()
61 | return count
62 | d=input()
63 | countB(d)1
--------------------------------------------------------------------------------
/7th_sept.py:
--------------------------------------------------------------------------------
1 | #wap to add 10 consecutive nos.
2 | num=0
3 | sum=0
4 | while num<=10:
5 | sum=sum+num
6 | num=num+1
7 | print(sum)
--------------------------------------------------------------------------------
/7th_sept_1.py:
--------------------------------------------------------------------------------
1 | #write a program to find the sum of digits of a given eber
2 | e=eval(input("enter the no. :"))
3 | s=0
4 | rem=0
5 | while e>0:
6 | rem=e%10
7 | e=e//10
8 | s=s+rem
9 | print(s)
10 |
11 |
--------------------------------------------------------------------------------
/7th_sept_2.py:
--------------------------------------------------------------------------------
1 | #wap to reverse the digits
2 | num=eval(input("enter the no.:"))
3 | rev=0
4 | rem=0
5 | while num>0:
6 | rem= num%10
7 | num= num//10
8 | rev=rev*10+rem
9 | print(rev)
10 |
--------------------------------------------------------------------------------
/7th_sept_3.py:
--------------------------------------------------------------------------------
1 | #wap to find the factorial of a given no.
2 | n=eval(input("enter the no. :"))
3 | fact=1
4 | result=1
5 | while fact<=n:
6 | result=result*fact
7 | fact=fact+1
8 | print(result)
--------------------------------------------------------------------------------
/8th_sept.py:
--------------------------------------------------------------------------------
1 | #for loop
2 | for i in range(1,25):
3 | if i%2==0:
4 | print(i)
--------------------------------------------------------------------------------
/8th_sept_1.py:
--------------------------------------------------------------------------------
1 | #WAP to get the sum of the nos. from 1 to 20 that are not divisible by 2,3 or 5
2 | s=0
3 | for i in range(1,20):
4 | if i%2==0 or i%3==0 or i%5==0:
5 | continue
6 | else:
7 | s=s+i
8 | print(s)
--------------------------------------------------------------------------------
/8th_sept_2.py:
--------------------------------------------------------------------------------
1 | s=0
2 | d=0
3 | for i in range(1,31,2):
4 | if i%2==0 or i%5==0:
5 | s=s+i
6 | else:
7 | d=d+i
8 | print(d-s)
9 |
--------------------------------------------------------------------------------
/9th_nov.py:
--------------------------------------------------------------------------------
1 | #print the vowels
2 | #change the case of the letters
3 | #eliminate character that is given input by the user
4 | '''a=input("Enter the value for which the case is to be changed : ")
5 | print(a.swapcase())
6 | c=["a","e","i","o","u","A","E","I","O","U"]
7 | for vowel in a:
8 | i=[]
9 | if vowel in c:
10 | i=i.append(vowel)
11 | print( vowel)
12 | print(i)
13 | d=input("Enter the letter to be replaced : ")
14 | x=input("Enter the letter that will replace the given letter : ")
15 | e=a.replace(d,x,1)
16 | print(e)'''
17 | '''l1=["Raamu,Shaamu","18,20","kela,seb","car,train"]
18 | l2=["seeta,geeta","16,18","gajar,mooli","cycle,scooty"]
19 | print(l1+l2)
20 | print(l1 in l2)
21 | print((l1,l2)*3)
22 | print(l1 is l2)
23 | del l1[1]
24 | print(l1)'''
25 |
26 | b=[]
27 | a=int(input("enter the no. of list items : "))
28 | for i in range(0,a):
29 | m=int(input())
30 | b.append(m)
31 | print("list given input by user:",b)
32 | l1=[]
33 | l2=[]
34 | for i in b:
35 | if i%2==0:
36 | l1.append(i)
37 | else:
38 | l2.append(i)
39 | print("even elements in the list:",l1)
40 | print("odd elements in the list:",l2)
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 | '''a=[]
71 | b=int(input("Enter the no. of elements : "))
72 | for i in range(0,b):
73 | f=int(input())
74 | a.append(f)
75 | print(a)'''
76 |
77 |
78 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------
/NEW.py:
--------------------------------------------------------------------------------
1 | # class Student:
2 | # def __init__ (self,name,age,email):
3 | # self.name=name
4 | # self.age=age
5 | # self.email=email
6 | # Stud_1 = Student('Sri ram',25,'ram@sch.com')
7 | # Stud_2 = Student('raghu ram',28,'lak@sch.com')
8 | # print('s1d =', Stud_1.name, Stud_1.age, Stud_1.email)
9 | # print('s2d =', Stud_2.name, Stud_2.age, Stud_2.email)
10 |
11 | class Student:
12 | pass
13 | Stud_1 = Student()
14 | Stud_2 = Student()
15 | name=input("name: ")
16 | age=int(input("age: "))
17 | email=input("email:")
18 | name1=input("name 1: ")
19 | age1=int(input("age 1: "))
20 | email1=input("email 1:")
21 | Stud_1.name = name
22 | Stud_1.age=age
23 | Stud_1.email=email
24 | Stud_2.name1 = name1
25 | Stud_2.age1=age1
26 | Stud_2.email1=email1
27 | print("Stud_1.name:", Stud_1.name)
28 | print("Stud_1.age:", Stud_1.age)
29 | print("Stud_1.email:", Stud_1.email)
30 | print("Stud_2.name:", Stud_2.name1)
31 | print("Stud_2.age:", Stud_2.age1)
32 | print("Stud_2.email:", Stud_2.email1)
33 |
34 |
35 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Python
2 |
3 | All the python codes that i write will be present here.
4 |
--------------------------------------------------------------------------------
/dict_23_nov.py:
--------------------------------------------------------------------------------
1 | # state={1:"a",2:"b"}
2 | # capital=state.copy()
3 | # print(capital)
4 | # for x in state:
5 | # print(state[x])
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/dictionary.py:
--------------------------------------------------------------------------------
1 | #collection of key value pairs
2 |
--------------------------------------------------------------------------------
/facto.py:
--------------------------------------------------------------------------------
1 | n=eval(input("enter the no. :"))
2 | import math
3 | i= math.factorial(n)
4 | print(i)
--------------------------------------------------------------------------------
/factorail.py:
--------------------------------------------------------------------------------
1 | # Program to find the factorail of a given number
2 | a=1
3 | b=int(input("Enter the no. for which you want to find the factorial: "))
4 | for i in range(0,b+1):
5 | if i>1:
6 | a=a*i
7 | print(a)
8 |
--------------------------------------------------------------------------------
/first_class.py:
--------------------------------------------------------------------------------
1 | E=int(input(" enter the marks obtained in english :"))
2 | M=int(input("enter the marks obtained in maths :"))
3 | C=int(input("enter the marks obtained in chemistry :"))
4 | P=int(input ("enter the marks obtained in physics :"))
5 | CS=int(input("enter the marks obtained in computer science"))
6 | PHE=int(input("enter the marks obtained in physical education"))
7 | Total=E+M+P+CS+PHE+C
8 | print(Total)
9 | p= Total/600 * 100
10 | print(p)
11 | if p>=90:
12 | print("grade=A")
13 | elif p<90 and p>80:
14 | print("grade=B")
15 | elif p<80 and p>70:
16 | print("grade=C")
17 | elif p<70 and p>60:
18 | print("grade=D")
19 | else:
20 | print("FAIL")
21 |
22 |
--------------------------------------------------------------------------------
/gst.py:
--------------------------------------------------------------------------------
1 | cost=int(input("Enter the cost :"))
2 | CGST=int(input("Enter the CGST :"))
3 | SGST=int(input("Enter the SGST :"))
4 | aoc = 9/100*cost
5 | aos = 9/100*cost
6 | Total_cost = cost+ aoc+ aos
7 | print("CGST on cost =", aoc)
8 | print("SGST on cost =", aos)
9 | print("Total cost = ",Total_cost)
10 |
--------------------------------------------------------------------------------
/gst0.py:
--------------------------------------------------------------------------------
1 | C=int(input("Enter cost : "))
2 | cgst=9/100*C
3 | sgst=9/100*C
4 | total=C+cgst+sgst
5 | print("CGST on Product @9%: ",cgst)
6 | print("SGST on Product @9%: ",sgst)
7 | print("Total cost is= ", total)
--------------------------------------------------------------------------------
/h.py:
--------------------------------------------------------------------------------
1 | a=input()
2 | b=["1","3","5","7","9"]
3 | if a[3] in b:
4 | c=a.replace("7","o")
5 | print(c)
6 | else:
7 | print(a)
8 |
9 |
--------------------------------------------------------------------------------
/halu.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ash-codes18/Python/b7bddc844d9d34e8524f2e39e13a15d814b6997c/halu.py
--------------------------------------------------------------------------------
/haua.py:
--------------------------------------------------------------------------------
1 | def halua(x):
2 | c=0
3 | for i in x:
4 | c=c+i
5 | return c
6 | x=int(input())
7 | y=int(input())
8 | z=int(input())
9 | l=[x,y,z]
10 | b=[]
11 | c=[]
12 | dd=[]
13 | for b in l:
14 | for c in l:
15 | for d in l:
16 | cc=[b,c,d]
17 | dd.append(cc)
18 | dd.sort(key=halua)
19 | print(dd)
20 |
21 |
22 | #b.append(x)
23 | # c.append(y)
24 | # d.append(z)
25 | # if (x+y+z!=3):
26 | # print(list)
--------------------------------------------------------------------------------
/jj.py:
--------------------------------------------------------------------------------
1 | """ Mad Libs Generator
2 |
3 | ----------------------------------------
4 |
5 | """
6 |
7 | #Loop back to this point once code finishes
8 |
9 | loop = 1
10 |
11 | while (loop < 10):
12 |
13 | # All the questions that the program asks the user
14 |
15 | noun = input("Choose a noun: ")
16 |
17 | p_noun = input("Choose a plural noun: ")
18 |
19 | noun2 = input("Choose a noun: ")
20 |
21 | place = input("Name a place: ")
22 |
23 | adjective = input("Choose an adjective (Describing word): ")
24 |
25 | noun3 = input("Choose a noun: ")
26 |
27 | #Displays the story based on the users input
28 |
29 | print ("------------------------------------------")
30 |
31 | print ("Be kind to your",noun,"- footed", p_noun)
32 |
33 | print ("For a duck may be somebody's", noun2,",")
34 |
35 | print ("Be kind to your",p_noun,"in",place)
36 |
37 | print ("Where the weather is always",adjective,".")
38 |
39 | print ()
40 |
41 | print ("You may think that is this the",noun3,",")
42 |
43 | print ("Well it is.")
44 |
45 | print ("------------------------------------------")
46 |
47 | # Loop back to "loop = 1"
48 |
49 | loop = loop + 1
--------------------------------------------------------------------------------
/k.py:
--------------------------------------------------------------------------------
1 | class halua(self,name,age):
2 | self.name=name
3 | self.age=age
4 | def halue(name,age):
5 | if i in range(age):
6 | print(i)
7 | halua()
--------------------------------------------------------------------------------
/list.py:
--------------------------------------------------------------------------------
1 | a=["halua","is", "op", "asf", "you", "just", "want", "to", "keep", "eating", "it"]
2 | a[0]= "gajar"
3 | print(a)
4 | b=["in", "kutto", "ke", "saamne", "basanti", "kabhi", "nahi", "nachegi", 69, 420, 9211, 920, 786]
5 | print(b[0:5])
6 | print(b[-8:-1])
--------------------------------------------------------------------------------
/list_functions.py:
--------------------------------------------------------------------------------
1 | #.sort() --> arranges the elements in ascending order
2 | l=[2,4,55,85,453,62,13,5,6,8]
3 | #l.sort()
4 |
5 | #.reverse() --> reverses the list
6 | #l.reverse()
7 |
8 | #.append() --> adds an element at the end of the list
9 | #l.append(69)
10 |
11 | #.insert(index, no.) --> inserts an element at the given index
12 | #l.insert(3,44)
13 |
14 | #.pop() --> deletes the element at the given index
15 | #l.pop(2)
16 |
17 | #.remove() --> removes the given element from the list
18 | #l.remove(4)
19 |
20 | #.extend() --> adds element at
21 |
22 | print(l)
23 |
--------------------------------------------------------------------------------
/okkkk.py:
--------------------------------------------------------------------------------
1 | # module from python library
2 |
3 | from tkinter import * # tkinter for GUI
4 | from decimal import Decimal #for round figur of cgpa and tga
5 | import sqlite3 #for database work
6 | from tkinter import ttk #for special effect in tgpa
7 | import re #for decription of data
8 |
9 | # for encription
10 | def change(a):
11 | a=list(a)
12 | str=""
13 | for i in a:
14 | i=ord(i)
15 | i=i+1
16 | i=chr(i)
17 | str=str+i
18 | return str
19 |
20 | #for dicription
21 | def unchange(a):
22 | a=list(a)
23 | st=""
24 | for i in a:
25 | i=ord(i)
26 | i=i-1
27 | i=chr(i)
28 | st=st+i
29 | return st
30 |
31 | #for calculating term 1 Tgpa
32 | def tgpa1():
33 | a=int(a1.get())
34 | b=int(b1.get())
35 | c=int(c1.get())
36 | d=int(d1.get())
37 | e=int(e1.get())
38 | f=int(f1.get())
39 | g=int(g1.get())
40 | h=int(h1.get())
41 | i=int(i1.get())
42 | j=int(j1.get())
43 | k=int(k1.get())
44 | l=int(l1.get())
45 | re1=(a*b)+(c*d)+(e*f)+(g*h)+(i*j)+(k*l)
46 | xs1=(b+d+f+h+j+l)*9.5
47 | pres1=re1/xs1
48 | res1=round(pres1,2)
49 | if (res1>10):
50 | dire5.set('10')
51 | else:
52 | dire5.set(res1)
53 | return res1
54 |
55 | #for calculating term 2 Tgpa
56 | def tgpa2():
57 | a3=int(a2.get())
58 | b3=int(b2.get())
59 | c3=int(c2.get())
60 | d3=int(d2.get())
61 | e3=int(e2.get())
62 | f3=int(f2.get())
63 | g3=int(g2.get())
64 | h3=int(h2.get())
65 | i3=int(i2.get())
66 | j3=int(j2.get())
67 | k3=int(k2.get())
68 | l3=int(l2.get())
69 | re3=(a3*b3)+(c3*d3)+(e3*f3)+(g3*h3)+(i3*j3)+(k3*l3)
70 | xs3=(b3+d3+f3+h3+j3+l3)*9.5
71 | pres3=re3/xs3
72 | res2=round(pres3,2)
73 | if (res2>10):
74 | dire4.set('10')
75 | else:
76 | dire4.set(res2)
77 | return res2
78 |
79 | #for calculating combined Cgpa,Remark,Grade
80 | def cgpa():
81 | a=int(a1.get())
82 | b=int(b1.get())
83 | c=int(c1.get())
84 | d=int(d1.get())
85 | e=int(e1.get())
86 | f=int(f1.get())
87 | g=int(g1.get())
88 | h=int(h1.get())
89 | i=int(i1.get())
90 | j=int(j1.get())
91 | k=int(k1.get())
92 | l=int(l1.get())
93 | a3=int(a2.get())
94 | b3=int(b2.get())
95 | c3=int(c2.get())
96 | d3=int(d2.get())
97 | e3=int(e2.get())
98 | f3=int(f2.get())
99 | g3=int(g2.get())
100 | h3=int(h2.get())
101 | i3=int(i2.get())
102 | j3=int(j2.get())
103 | k3=int(k2.get())
104 | l3=int(l2.get())
105 | name = str(name1.get())
106 | name=change(name)
107 |
108 | reg = str(reg1.get())
109 | reg=change(reg)
110 |
111 | re3=(a3*b3)+(c3*d3)+(e3*f3)+(g3*h3)+(i3*j3)+(k3*l3)+(a*b)+(c*d)+(e*f)+(g*h)+(i*j)+(k*l)
112 | xs3=(b3+d3+f3+h3+j3+l3+b+d+f+h+j+l)*9.5
113 | pres3=re3/xs3
114 | res3=round(pres3,2)
115 | if (res3>10):
116 | dire.set('10')
117 | else:
118 | dire.set(res3)
119 | remark=res3
120 | if(remark<6):
121 | dire6.set('Need of Improvment [C]')
122 | elif(remark>=6 and remark<7):
123 | dire6.set('Ok but can be Improved [B]')
124 | elif(remark>=7 and remark<8):
125 | dire6.set('Good Keep Going [B+]')
126 | elif(remark>=8 and remark<9):
127 | dire6.set('V.Good Keep Going [A]')
128 | elif(remark>=9 and remark<=10):
129 | dire6.set('Brilliant [A+]')
130 | else:
131 | pass
132 |
133 | #for sending data in Database after encrition
134 |
135 | tgpaa=tgpa1()
136 | tgpab=tgpa2()
137 | cgpa = res3
138 | conn = sqlite3.connect('mysql.db')
139 | with conn:
140 | cursor = conn.cursor()
141 | cursor.execute('INSERT INTO result(name, id, tgpa1, tgpa2, cgpa) VALUES(?,?,?,?,?)',(name, reg, tgpaa, tgpab, cgpa))
142 | db.close()
143 |
144 | #for fatching data from Database
145 |
146 | def search():
147 | search=str(search1.get())
148 | search=change(search)
149 | conn = sqlite3.connect('mysql.db')
150 | cursor = conn.cursor()
151 |
152 | cursor.execute('SELECT name FROM result where id ='+search)
153 | a=cursor.fetchall()
154 | a=str(a)
155 | a=unchange(a) #using decription
156 | a = " ".join(re.findall("[a-z]+", a))
157 | pos1.set(a.capitalize())
158 |
159 | cursor.execute('SELECT id FROM result where id ='+search)
160 | b=cursor.fetchall()
161 | b=str(b)
162 | b=unchange(b) #using decription
163 | b = " ".join(re.findall("[0-9]+", b))
164 | pos2.set(b)
165 |
166 | cursor.execute('SELECT tgpa1 FROM result where id ='+search)
167 | c=cursor.fetchall()
168 | pos3.set(c)
169 |
170 | cursor.execute('SELECT tgpa2 FROM result where id ='+search)
171 | d=cursor.fetchall()
172 | pos4.set(d)
173 |
174 | cursor.execute('SELECT cgpa FROM result where id ='+search)
175 | e=cursor.fetchall()
176 | pos5.set(e)
177 |
178 | # To clear all entry field and label for reusing again and again
179 |
180 | def reset():
181 | a1.set("")
182 | b1.set("")
183 | c1.set("")
184 | d1.set("")
185 | e1.set("")
186 | f1.set("")
187 | g1.set("")
188 | h1.set("")
189 | i1.set("")
190 | j1.set("")
191 | k1.set("")
192 | l1.set("")
193 | a2.set("")
194 | b2.set("")
195 | c2.set("")
196 | d2.set("")
197 | e2.set("")
198 | f2.set("")
199 | g2.set("")
200 | h2.set("")
201 | i2.set("")
202 | j2.set("")
203 | k2.set("")
204 | l2.set("")
205 | name1.set("")
206 | reg1.set("")
207 | search1.set("")
208 | pos1.set("")
209 | pos2.set("")
210 | pos3.set("")
211 | pos4.set("")
212 | pos5.set("")
213 | dire5.set("")
214 | dire.set("")
215 | dire4.set("")
216 | dire6.set("")
217 |
218 | win=Tk()
219 | win.geometry("680x750")
220 | win.title('Cgpa Calculator')
221 | win.configure(bg='#F88379')
222 |
223 | db = sqlite3.connect('mysql.db')
224 | cursor = db.cursor()
225 | cursor.execute("CREATE TABLE IF NOT EXISTS result(name TEXT, id TEXT PRIMARY KEY, tgpa1 REAL, tgpa2 REAL, cgpa REAL)")
226 | db.commit()
227 |
228 | # initialising all varables
229 |
230 | a1=StringVar()
231 | b1=StringVar()
232 | c1=StringVar()
233 | d1=StringVar()
234 | e1=StringVar()
235 | f1=StringVar()
236 | g1=StringVar()
237 | h1=StringVar()
238 | i1=StringVar()
239 | j1=StringVar()
240 | k1=StringVar()
241 | l1=StringVar()
242 |
243 | a2=StringVar()
244 | b2=StringVar()
245 | c2=StringVar()
246 | d2=StringVar()
247 | e2=StringVar()
248 | f2=StringVar()
249 | g2=StringVar()
250 | h2=StringVar()
251 | i2=StringVar()
252 | j2=StringVar()
253 | k2=StringVar()
254 | l2=StringVar()
255 |
256 | name1=StringVar()
257 | reg1=StringVar()
258 | search1=StringVar()
259 |
260 | pos1 = StringVar()
261 | pos2 = StringVar()
262 | pos3 = StringVar()
263 | pos4 = StringVar()
264 | pos5 = StringVar()
265 |
266 | #starting of GUI..................
267 |
268 | #part 1 of GUI
269 | lab=Label(win,text="",bg="#F88379") #label
270 | lab.grid(row=1,column=1)
271 | dire=Label(win,text="SEMESTER-1",font="Helvetica 15 bold",bg="#00cca3") #label
272 | dire.grid(row=1,column=6)
273 |
274 | dire=Label(win,text="Marks ",bg="#F88379",font="Times 11 bold") #label
275 | dire.grid(row=2,column=6)
276 | dire=Label(win,text="Credit ",bg="#F88379",font="Times 11 bold") #label
277 | dire.grid(row=2,column=8)
278 |
279 |
280 | dire=Label(win,text="Subject 1 : ",bg="#F88379",font="Times 11 bold") #label
281 | dire.grid(row=4,column=1)
282 |
283 | entry1=Entry(win,textvariable=a1,justify='center') #Entry field
284 | entry1.grid(row=4,column=6)
285 |
286 | entry2=Entry(win,textvariable=b1,justify='center') #Entry field
287 | entry2.grid(row=4,column=8)
288 |
289 | dire=Label(win,text="Subject 2 : ",bg="#F88379",font="Times 11 bold") #label
290 | dire.grid(row=5,column=1)
291 |
292 | entry3=Entry(win,textvariable=c1,justify='center') #Entry field
293 | entry3.grid(row=5,column=6)
294 |
295 | entry4=Entry(win,textvariable=d1,justify='center') #Entry field
296 | entry4.grid(row=5,column=8)
297 |
298 | dire=Label(win,text="Subject 3 : ",bg="#F88379",font="Times 11 bold") #label
299 | dire.grid(row=6,column=1)
300 |
301 | entry5=Entry(win,textvariable=e1,justify='center') #Entry field
302 | entry5.grid(row=6,column=6)
303 |
304 | entry6=Entry(win,textvariable=f1,justify='center') #Entry field
305 | entry6.grid(row=6,column=8)
306 |
307 | dire=Label(win,text="Subject 4 : ",bg="#F88379",font="Times 11 bold") #label
308 | dire.grid(row=7,column=1)
309 |
310 | entry7=Entry(win,textvariable=g1,justify='center') #Entry field
311 | entry7.grid(row=7,column=6)
312 |
313 | entry8=Entry(win,textvariable=h1,justify='center') #Entry field
314 | entry8.grid(row=7,column=8)
315 |
316 | dire=Label(win,text="Subject 5 : ",bg="#F88379",font="Times 11 bold") #label
317 | dire.grid(row=8,column=1)
318 |
319 | entry9=Entry(win,textvariable=i1,justify='center') #Entry field
320 | entry9.grid(row=8,column=6)
321 |
322 | entry10=Entry(win,textvariable=j1,justify='center') #Entry field
323 | entry10.grid(row=8,column=8)
324 |
325 | dire=Label(win,text="Subject 6 : ",bg="#F88379",font="Times 11 bold") #label
326 | dire.grid(row=9,column=1)
327 |
328 | entry11=Entry(win,textvariable=k1,justify='center') #Entry field
329 | entry11.grid(row=9,column=6)
330 |
331 | entry12=Entry(win,textvariable=l1,justify='center') #Entry field
332 | entry12.grid(row=9,column=8)
333 |
334 | button1=ttk.Button(win,text="Find Tgpa",command=tgpa1) #Button for action
335 | button1.grid(row=6,column=14)
336 |
337 | dire5=StringVar()
338 |
339 | dire1=Label(win,text="Tgpa1:",bg="#F88379",font="Times 11 bold") #label
340 | dire1.grid(row=8,column=12)
341 | dire1=Label(win,textvariable=dire5,bg="#F88379") #label
342 | dire1.grid(row=8,column=14)
343 |
344 |
345 | lab=Label(win,text=" ",bg="#F88379") #label
346 | lab.grid(row=10,column=1)
347 | dire=Label(win,text="SEMESTER-2",font="Helvetica 15 bold",bg="#00cca3") #label
348 | dire.grid(row=10,column=6)
349 |
350 | dire=Label(win,text="Marks ",bg="#F88379",font="Times 11 bold") #label
351 | dire.grid(row=11,column=6)
352 | dire=Label(win,text="Credit ",bg="#F88379",font="Times 11 bold") #label
353 | dire.grid(row=11,column=8)
354 |
355 | dire=Label(win,text="Subject 1 : ",bg="#F88379",font="Times 11 bold") #label
356 | dire.grid(row=12,column=1)
357 |
358 | entry1=Entry(win,textvariable=a2,justify='center') #Entry field
359 | entry1.grid(row=12,column=6)
360 |
361 | entry2=Entry(win,textvariable=b2,justify='center') #Entry field
362 | entry2.grid(row=12,column=8)
363 |
364 | dire=Label(win,text="Subject 2 : ",bg="#F88379",font="Times 11 bold") #label
365 | dire.grid(row=13,column=1)
366 |
367 | entry3=Entry(win,textvariable=c2,justify='center') #Entry field
368 | entry3.grid(row=13,column=6)
369 |
370 | entry4=Entry(win,textvariable=d2,justify='center') #Entry field
371 | entry4.grid(row=13,column=8)
372 |
373 | dire=Label(win,text="Subject 3 : ",bg="#F88379",font="Times 11 bold") #label
374 | dire.grid(row=14,column=1)
375 |
376 | entry5=Entry(win,textvariable=e2,justify='center') #Entry field
377 | entry5.grid(row=14,column=6)
378 |
379 | entry6=Entry(win,textvariable=f2,justify='center') #Entry field
380 | entry6.grid(row=14,column=8)
381 |
382 | dire=Label(win,text="Subject 4 : ",bg="#F88379",font="Times 11 bold") #label
383 | dire.grid(row=15,column=1)
384 |
385 | entry7=Entry(win,textvariable=g2,justify='center') #Entry field
386 | entry7.grid(row=15,column=6)
387 |
388 | entry8=Entry(win,textvariable=h2,justify='center') #Entry field
389 | entry8.grid(row=15,column=8)
390 |
391 | dire=Label(win,text="Subject 5 : ",bg="#F88379",font="Times 11 bold") #label
392 | dire.grid(row=16,column=1)
393 |
394 | entry9=Entry(win,textvariable=i2,justify='center') #Entry field
395 | entry9.grid(row=16,column=6)
396 |
397 | entry10=Entry(win,textvariable=j2,justify='center') #Entry field
398 | entry10.grid(row=16,column=8)
399 |
400 | dire=Label(win,text="Subject 6 : ",bg="#F88379",font="Times 11 bold") #label
401 | dire.grid(row=17,column=1)
402 |
403 | entry11=Entry(win,textvariable=k2,justify='center') #Entry field
404 | entry11.grid(row=17,column=6)
405 |
406 | entry12=Entry(win,textvariable=l2,justify='center') #Entry field
407 | entry12.grid(row=17,column=8)
408 |
409 | button1=ttk.Button(win,text="Find Tgpa",command=tgpa2) #Button for action
410 | button1.grid(row=14,column=14)
411 |
412 | dire4=StringVar()
413 |
414 | dire1=Label(win,text="Tgpa2:",bg="#F88379",font="Times 11 bold") #label
415 | dire1.grid(row=16,column=12)
416 | dire1=Label(win,textvariable=dire4,bg="#F88379") #label
417 | dire1.grid(row=16,column=14)
418 |
419 | lab=Label(win,text=" ",bg="#F88379") #label
420 | lab.grid(row=18,column=6)
421 |
422 | dire=Label(win,text="Name : ",bg="#F88379",font="Times 11 bold") #label
423 | dire.grid(row=19,column=1)
424 |
425 | entry14=Entry(win,textvariable=name1,justify='center') #Entry field
426 | entry14.grid(row=19,column=6)
427 |
428 | dire=Label(win,text="Reg No : ",bg="#F88379",font="Times 11 bold") #label
429 | dire.grid(row=21,column=1)
430 |
431 | entry15=Entry(win,textvariable=reg1,justify='center') #Entry field
432 | entry15.grid(row=21,column=6)
433 |
434 | lab=Label(win,text=" ",bg="#F88379") #label
435 | lab.grid(row=22,column=6)
436 |
437 | button1=ttk.Button(win,text="Find cgpa",width=10,command=cgpa) #Button for action
438 | button1.grid(row=23,column=4)
439 |
440 | dire=StringVar()
441 |
442 | dire1=Label(win,text="Cgpa : ",bg="#F88379",font="Times 11 bold") #label
443 | dire1.grid(row=23,column=6)
444 | dire1=Label(win,textvariable=dire,bg="#F88379") #label
445 | dire1.grid(row=23,column=8)
446 |
447 | dire6=StringVar()
448 |
449 | dire1=Label(win,text="Remark : ",bg="#F88379",font="Times 11 bold") #label
450 | dire1.grid(row=25,column=4)
451 | dire1=Label(win,textvariable=dire6,bg="#F88379") #label
452 | dire1.grid(row=25,column=6)
453 |
454 | lab=Label(win,text=" ",bg="#F88379") #label
455 | lab.grid(row=26,column=6)
456 |
457 | #part 2 of GUI
458 |
459 | button_reset=ttk.Button(win,text="Reset All The Data",width=20,command=reset) #Button for action
460 | button_reset.grid(row=27,column=6)
461 |
462 | lab=Label(win,text=" ",bg="#F88379") #label
463 | lab.grid(row=28,column=6)
464 |
465 |
466 | entry14=Entry(win,textvariable=search1,justify='center') #Entry field
467 | entry14.grid(row=29,column=6)
468 |
469 | button1=ttk.Button(win,text="Search",width=10,command = search) #Button for action
470 | button1.grid(row=29,column=7)
471 |
472 | pos6 = Label(win,text = "Name:",bg="#F88379",font="Times 11 bold") #label
473 | pos6.grid(row=30,column=1)
474 | pos6=Label(win,textvariable=pos1,bg="#F88379") #label
475 | pos6.grid(row=30,column=6)
476 |
477 | pos7 = Label(win,text = "Id:",bg="#F88379",font="Times 11 bold") #label
478 | pos7.grid(row=31,column=1)
479 | pos7=Label(win,textvariable=pos2,bg="#F88379") #label
480 | pos7.grid(row=31,column=6)
481 |
482 | pos8 = Label(win,text = "Tgpa1:",bg="#F88379",font="Times 11 bold") #label
483 | pos8.grid(row=32,column=1)
484 | pos8=Label(win,textvariable=pos3,bg="#F88379") #label
485 | pos8.grid(row=32,column=6)
486 |
487 | pos9 = Label(win,text = "Tgpa2:",bg="#F88379",font="Times 11 bold") #label
488 | pos9.grid(row=33,column=1)
489 | pos9=Label(win,textvariable=pos4,bg="#F88379") #label
490 | pos9.grid(row=33,column=6)
491 |
492 | pos10 = Label(win,text = "Cgpa:",bg="#F88379",font="Times 11 bold") #label
493 | pos10.grid(row=34,column=1)
494 | pos10=Label(win,textvariable=pos5,bg="#F88379") #label
495 | pos10.grid(row=34,column=6)
496 |
497 | win.mainloop()
498 |
499 | # end of GUI
--------------------------------------------------------------------------------
/practice_00.py:
--------------------------------------------------------------------------------
1 | letter = ''' Dear name,
2 | \tGreetings from Google. I am happy to inform you about your selection for the role of a software developer.
3 | \tBest of luck for your future!
4 | \tHave a great day ahead!
5 |
6 | Basanti
7 | Date: date'''
8 | n=input("Enter the name :")
9 | d=input("Enter the date :")
10 | letter=letter.replace("name", n)
11 | letter=letter.replace("date", d)
12 | print(letter)
--------------------------------------------------------------------------------
/practice_01.py:
--------------------------------------------------------------------------------
1 | '''a=("apple", "banana", "mango", "papaya", "guava", "kiwi", "pomogranate")
2 | print(a)'''
3 |
4 |
5 | '''f1=input("Enter fruit no.1 :")
6 | f2=input("Enter fruit no.2 :")
7 | f3=input("Enter fruit no.3 :")
8 | f4=input("Enter fruit no.4 :")
9 | f5=input("Enter fruit no.5 :")S
10 | f6=input("Enter fruit no.6 :")
11 | f7=input("Enter fruit no.7 :")
12 | a=(f1,f2,f3,f4,f5,f6,f7)
13 | print(a)'''
14 |
15 |
16 | '''m1=int(input("Enter the marks of student 1:"))
17 | m2=int(input("Enter the marks of student 2:"))
18 | m3=int(input("Enter the marks of student 3:"))
19 | m4=int(input("Enter the marks of student 4:"))
20 | m5=int(input("Enter the marks of student 5:"))
21 | m6=int(input("Enter the marks of student 6:"))
22 | marks=[m1,m2,m3,m4,m5,m6]
23 | m=marks.sort()
24 | print(marks)'''
25 |
26 |
27 | '''a=[44,5,67,3]
28 | b=a[0]+a[1]+a[2]+a[3]
29 | print(b)
30 | #or
31 | print(sum(a))'''
32 |
33 | '''a=(7,0,8,0,0,9)
34 | print(a.count(0))'''
35 |
36 |
--------------------------------------------------------------------------------
/prime_no.py:
--------------------------------------------------------------------------------
1 | a = 1
2 | b = 101
3 | print("Prime number between",a,"and 100","are:")
4 | for c in range(a,b):
5 | if c>1:
6 | for i in range(2,c):
7 | if (c%i)==0:
8 | break
9 | else:
10 | print(c)
--------------------------------------------------------------------------------
/priyanshu.py:
--------------------------------------------------------------------------------
1 | '''
2 | a=int(input())
3 | d="* "*(a)
4 | c=len(d)
5 | c=c-3
6 | e="#"*c
7 | print(d)
8 | for i in range(a-2):
9 | print("*","*",sep=e)
10 | print(d)
11 | print()
12 | print("*")'''
13 |
14 | a=int(input("rows: "))
15 | print()
16 | for i in range(a):
17 | for k in range(a):
18 | print("*",end=" ")
19 | print()
20 |
21 | print()
22 | print()
23 |
24 |
25 | print("For empty square :",a)
26 | print()
27 | for p in range(a):
28 | if p==0 or p==(a-1):
29 | for q in range(a):
30 | print("*",end=" ")
31 | print()
32 | else:
33 | for f in range(a):
34 | if f==0 or f==a-1:
35 | print("*",end=" ")
36 | else:
37 | print(" ",end=" ")
38 | print()
39 |
40 | print()
41 | print()
42 |
43 | print("For diagonals square:",a)
44 | print()
45 | for p in range(a):
46 | if p==0 or p==(a-1):
47 | for q in range(a):
48 | print("*",end=" ")
49 | print()
50 | else:
51 | for f in range(a):
52 | if f==p or f==a-p-1:
53 | print("*",end=" ")
54 | elif f==0 or f==(a-1):
55 | print("*",end=" ")
56 | else:
57 | print(" ",end=" ")
58 | print()
59 |
60 | print()
61 | print()
62 |
63 | print("For diagonals square empty:",a)
64 | print()
65 | for p in range(a):
66 | if p==0 or p==(a-1):
67 | for q in range(a):
68 | print("*",end=" ")
69 | print()
70 | else:
71 | for f in range(a):
72 | if f==p:
73 | print(" ",end=" ")
74 | elif f==0 or f==(a-1):
75 | print("*",end=" ")
76 | else:
77 | print("*",end=" ")
78 | print()
79 |
80 | print()
81 |
82 | print("For diagonals square empty:",a)
83 | print()
84 | for p in range(a):
85 | if p==0 or p==(a-1):
86 | for q in range(a):
87 | print("*",end=" ")
88 | print()
89 | else:
90 | for f in range(a):
91 | if f==a-p-1:
92 | print(" ",end=" ")
93 | elif f==0 or f==(a-1):
94 | print("*",end=" ")
95 | else:
96 | print("*",end=" ")
97 | print()
98 |
99 | print()
100 | print()
101 |
102 | print("For diagonals square:",a)
103 | print()
104 | for p in range(a):
105 | if p==0 or p==(a-1):
106 | for q in range(a):
107 | print("*",end=" ")
108 | print()
109 | else:
110 | for f in range(a):
111 | if f==p or f==a-p-1:
112 | print(" ",end=" ")
113 | elif f==0 or f==(a-1):
114 | print("*",end=" ")
115 | else:
116 | print("*",end=" ")
117 | print()
118 |
119 | print()
120 | print()
121 | for i in range(a):
122 | for j in range(a):
123 | if i==0 or i==a-1:
124 | print("*",end=" ")
125 | else:
126 | if j==0 or j==a-1 or j==a//2 or i==a//2:
127 | print("*",end=" ")
128 | else:
129 | print(" ",end=" ")
130 | print()
--------------------------------------------------------------------------------
/recursion.py:
--------------------------------------------------------------------------------
1 | n=int(input("Enter a no : "))
2 | def fun(a):
3 | if (a==0 | a==1):
4 | return 1
5 | else:
6 | return a*fun(a-1)
7 | print("The value of the factorial of",n,"is :",fun(n))
--------------------------------------------------------------------------------
/replace.py:
--------------------------------------------------------------------------------
1 |
2 | # print("ABC"<000"abc")
3 | # s1="ABC"
4 | # s2="abc"
5 | # print(s1==s2)
6 | # print(s1>s2)
7 | # print(s1>>>",Style.RESET_ALL,val,Fore.BLUE + l2[a-1],Style.RESET_ALL,"=","%.4f"%out,Fore.BLUE + l2[b-1],Style.RESET_ALL)
13 | return
14 |
15 | ############################ LISTS ########################################################
16 |
17 | l1=["1) INR-Indian Rupee","2) USD-US dollar", "3) CAD-Canadian dollar","4) CNY-Chinese yuan","5) RUB-Russia’s Rubal","6) EUR-Euro"]
18 | l2=["INR","USD", "CAD","CNY","RUB","EUR"]
19 |
20 | ############################# LOOP ##############################################################
21 |
22 | while True:
23 | print(''' ____ _
24 | / ___|___ _ ____ _____ _ __| |_ ___ _ __
25 | | | / _ \| '_ \ \ / / _ \ '__| __/ _ \ '__|
26 | | |__| (_) | | | \ V / __/ | | || __/ |
27 | \____\___/|_| |_|\_/ \___|_| \__\___|_|
28 | ''')
29 | print("The avilable options are:")
30 | print()
31 | for i in l1:
32 | print(" ",i)
33 | print()
34 |
35 |
36 | ############################ WRONG INPUT FOR "FROM__" ##############################
37 |
38 | print(Fore.GREEN)
39 | a=int(input("From __ (choose above options): "))
40 |
41 | if a<=len(l1):
42 | a=int(a)
43 | else:
44 | print(" >>>>>",Fore.RED + "Enter vaild input",Style.RESET_ALL)
45 | print(" Press",Fore.CYAN + '\033[1m' + 'ENTER' + '\033[0m',Style.RESET_ALL, "For Next Conversion")
46 | al=input()
47 | os.system("clear")
48 | continue
49 |
50 | print(" >>>>",Fore.BLUE + l2[a-1]+" is selected")
51 | print(Style.RESET_ALL)
52 | c=(l2[a-1])
53 |
54 | ############################ WRONG INPUT FOR "TO__" ##############################
55 |
56 | print(Fore.GREEN)
57 | b=int(input("{} To __ (choose above options): ".format(c)))
58 |
59 | if b<=len(l1):
60 | b=b
61 | else:
62 | print(" >>>>>",Fore.RED + "Enter vaild input",Style.RESET_ALL)
63 | print(" Press",Fore.CYAN + '\033[1m' + 'ENTER' + '\033[0m',Style.RESET_ALL, "For Next Conversion")
64 | al=input()
65 | os.system("clear")
66 | continue
67 |
68 | print(" >>>>",Fore.BLUE + l2[b-1]+" is selected")
69 | print()
70 | print(Fore.GREEN)
71 | c=(l2[a-1],l2[b-1])
72 | val=eval(input("Value for conversion %s to %s: "%c))
73 | print(Style.RESET_ALL)
74 |
75 |
76 | if a==b:
77 | mul(val,1)
78 | ############################ INR TO OTHERS ########################################################
79 |
80 | elif a==1 and b==2:
81 | mul(val,0.012114432)
82 | elif a==2 and b==1:
83 | mul(val,82.524641)
84 |
85 | elif a==1 and b==3:
86 | mul(val,0.16543757)
87 | elif a==3 and b==1:
88 | mul(val,60.436276)
89 |
90 | elif a==1 and b==4:
91 | mul(val,0.87739056)
92 | elif a==4 and b==1:
93 | mul(val,11.394784)
94 |
95 | elif a==1 and b==5:
96 | mul(val,0.74818389)
97 | elif a==5 and b==1:
98 | mul(val,1.3381059)
99 |
100 | elif a==1 and b==6:
101 | mul(val,0.012290295)
102 | elif a==6 and b==1:
103 | mul(val,81.345962)
104 |
105 | ################################ USD TO OTHER ###################################################################
106 |
107 | elif a==2 and b==3:
108 | mul(val,1.3665878)
109 | elif a==3 and b==2:
110 | mul(val,0.73171013)
111 |
112 | elif a==2 and b==4:
113 | mul(val,7.2434067)
114 | elif a==4 and b==2:
115 | mul(val,0.13805389)
116 |
117 | elif a==2 and b==5:
118 | mul(val,61.833713)
119 | elif a==5 and b==2:
120 | mul(val,0.016144115)
121 |
122 | elif a==2 and b==6:
123 | mul(val,1.0146885)
124 | elif a==6 and b==2:
125 | mul(val,0.98540154)
126 |
127 | ################################## CAD TO OTHER ################################################################
128 |
129 | elif a==3 and b==4:
130 | mul(val,5.3043698)
131 | elif a==4 and b==3:
132 | mul(val,0.18862945)
133 |
134 | elif a==3 and b==5:
135 | mul(val,45.194092)
136 | elif a==5 and b==3:
137 | mul(val,0.2214124)
138 |
139 | elif a==3 and b==6:
140 | mul(val,0.7430328)
141 | elif a==6 and b==3:
142 | mul(val,1.3457804)
143 |
144 | ################################### CNY TO OTHERS#######################################################
145 |
146 | elif a==4 and b==5:
147 | mul(val,8.5226981)
148 | elif a==5 and b==4:
149 | mul(val,0.11741431)
150 |
151 | elif a==4 and b==6:
152 | mul(val,0.14008219)
153 | elif a==6 and b==4:
154 | mul(val,7.1391185)
155 |
156 | ################################## RUB TO OTHERS ##############################################################
157 |
158 | elif a==5 and b==6:
159 | mul(val,0.016447669)
160 | elif a==6 and b==5:
161 | mul(val,60.925618)
162 | print()
163 | print()
164 | print(" Press",Fore.CYAN + '\033[1m' + 'ENTER' + '\033[0m',Style.RESET_ALL, "For Next Conversion")
165 | al=input()
166 | os.system("cls")
167 |
--------------------------------------------------------------------------------
/testing.py:
--------------------------------------------------------------------------------
1 | '''a=int(input())
2 | b=int(input())
3 | print(bin(a))
4 | print(bin(b))
5 | num1=a|b
6 | print(num1)'''
7 |
8 | p=int(input())
9 | q=int(input())
10 |
--------------------------------------------------------------------------------
/try.py:
--------------------------------------------------------------------------------
1 | def nameRank(names, marks, updates, n):
2 | x = [[0 for j in range(3)] for i in range(n)]
3 | for i in range(n):
4 | x[i][0] = names[i]
5 | x[i][1]= marks[i] + updates[i]
6 | x[i][2] = i + 1
7 |
8 | highest = x[0]
9 | for j in range(1, n):
10 | if (x[j][1] >= highest[1]):
11 | highest = x[j]
12 |
13 | print("Name: ", highest[0], ", Jump: ",
14 | abs(highest[2] - 1), sep="")
15 |
16 |
17 |
18 | names= ["sam", "ram", "goku"]
19 |
20 | marks = [80, 79, 75]
21 |
22 | updates = [0, 5, -9]
23 |
24 | n = len(marks)
25 |
26 | nameRank(names, marks, updates, n)
27 |
28 |
--------------------------------------------------------------------------------
/tuples.py:
--------------------------------------------------------------------------------
1 | #tuples --> can't be updates i.e they are immutable
2 | t=(1,2,3,4,5,6)
3 | #print(t[0])
4 | #lists are mutable and use square brackets
5 |
6 | #t=() #this is an empty tuple
7 |
8 | # the values of a tuple ends with a comma
9 | #t=(1) #is wrong
10 | #t=(1,) #is correct
11 | print(t)
--------------------------------------------------------------------------------
/tuples_functions.py:
--------------------------------------------------------------------------------
1 | #.count()
2 | t=(1,2,3,4,5,6,7,8,9,0,1,1,1,1,1,2,2,3,3,4,5,56,77,8,89,2)
3 | #print(t.count(1))
4 | #this prints the no. of the given element present in the tuple
5 |
6 | #.index()
7 | print(t.index(0))
8 |
--------------------------------------------------------------------------------