Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ANISH_KUMAR_DAY7.py #126

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions ANISH_KUMAR_DAY1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
'''
ANISH KUMAR
anish2272002@gmail.com
'''

num=int(input())
for i in range(num):
ab=input()
b=ab.split()
print(int(b[0])+int(b[1]))
8 changes: 8 additions & 0 deletions ANISH_KUMAR_DAY2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
num=int(input())
for i in range(num):
lst=[]
for j in range(3):
a=int(input())
lst.append(a)
lst.sort()
print(lst[1])
17 changes: 17 additions & 0 deletions ANISH_KUMAR_DAY3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
'''
ANISH KUMAR
ISE 2020-21
anish2272002@gmail.com
PYTHON
'''

N=int(input())
mat=[]
lst=[]
for i in range(N):
mat.append([])
for j in range(N):
a=int(input())
mat[i].append(a)
lst.append(mat[i].count(0))
print(lst.index(max(lst)))
19 changes: 19 additions & 0 deletions ANISH_KUMAR_DAY4.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
'''
Anish Kumar
anish2272002@gmail.com
ISE 2020-21
PYTHON
'''
def gcd(a,b):
if(b==0):
return a
return gcd(b,a%b)

N=int(input())
for i in range(N):
c=int(input())
num=input().split()
if(c==1):
print(gcd(int(num[0]),int(num[1])))
else:
print(int((int(num[0])*int(num[1]))/gcd(int(num[0]),int(num[1]))))
18 changes: 18 additions & 0 deletions ANISH_KUMAR_DAY5.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
'''
ANISH KUMAR
anish2272002@gmail.com
ISE 2020-21
PYTHON
'''

def fact(n):
if(n==0):
return 1
else:
return n*fact(n-1)

k=int(input())
for i in range(0,k):
for j in range(0,i+1):
print(int(fact(i)/(fact(i-j)*fact(j))),end=' ')
print()
54 changes: 54 additions & 0 deletions ANISH_KUMAR_DAY6.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
'''
ANISH KUMAR
anish2272002@gmail.com
ISE 2020-21
PYTHON
'''

class student():
Student_ID=int()
Name=str()
Class=int()
Section=str()
Total_marks=int()

st_record1=student()
st_record1.Student_ID=6
st_record1.Name='Anish'
st_record1.Class=12
st_record1.Section='A'
st_record1.Total_marks=450

st_record2=student()
st_record2.Student_ID=9
st_record2.Name='Aryan'
st_record2.Class=10
st_record2.Section='B'
st_record2.Total_marks=500

st_record3=student()
st_record3.Student_ID=4
st_record3.Name='Lily'
st_record3.Class=11
st_record3.Section='C'
st_record3.Total_marks=367

st_record4=student()
st_record4.Student_ID=7
st_record4.Name='Sam'
st_record4.Class=10
st_record4.Section='B'
st_record4.Total_marks=400

st_record5=student()
st_record5.Student_ID=1
st_record5.Name='John'
st_record5.Class=12
st_record5.Section='A'
st_record5.Total_marks=490

st_record=[st_record1,st_record2,st_record3,st_record4,st_record5]

rnum=int(input())-1
print('Student ID Name Class Section Total Marks')
print(st_record[rnum].Student_ID,' '+st_record[rnum].Name,st_record[rnum].Class,' '+st_record[rnum].Section+' ',st_record[rnum].Total_marks,sep=' ')
20 changes: 20 additions & 0 deletions ANISH_KUMAR_DAY7.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
'''
ANISH KUMAR
anish2272002@gmail.com
ISE 2020-21
PYTHON
'''

alpha=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
st=input()
s=0
var=0
for i in range(alpha.index(st[0]),alpha.index(st[-1])):
if(alpha[i]==st[s]):
s=s+1
else:
var=1
print(alpha[i],end=' ')

if(var==0):
print(None)