0% found this document useful (0 votes)
22 views

Assingnment 1

The document contains multiple Python code snippets that perform various tasks like calculating grades, Fibonacci series, prime numbers etc. Each code snippet prints the name, roll number and outputs the results. The document tests different Python programming concepts like loops, functions, lists, input/output etc. and concludes that the progress was executed successfully for each code snippet.

Uploaded by

roshan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

Assingnment 1

The document contains multiple Python code snippets that perform various tasks like calculating grades, Fibonacci series, prime numbers etc. Each code snippet prints the name, roll number and outputs the results. The document tests different Python programming concepts like loops, functions, lists, input/output etc. and concludes that the progress was executed successfully for each code snippet.

Uploaded by

roshan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 23

SOURCE CODE:

print("Name= S.Roshan")

print("Rollno=11413")

A=int(input("Enter the Accounts Mark:"))

E=int(input("Enter the Economics Mark:"))

C=int(input("Enter the Computer Mark:"))

T=A+E+C

P=(T/300)*100

G=None

print('The average mark is:',T/300)

if P>=80:

G="A"

print('Level 4,above agency - normalised standards')

if P>=69 and P<80:

G="B"

print('Level 3,above agency - normalised standards')

if P>=59 and P<70:

G="C"

print('Level 2,above agency - normalised standards')

if P>=49 and P<60:

G="D"
print('Level 1,above agency - normalised standards')

if P>=39 and P<50:

G="E"

print('Level 1-,too below agency - normalised standards')

if P<40:

G="R"

print('Remedial standards')

print('Your grade is ',G)

OUTPUT:

RESULT:
The progress is excuted sucessfully
SOURCE CODE:
print("Name = S.Roshan")

print("Roll no = 11413")

N=1

while N<21:

print("Square of",N,'---',N*N)

N+=1

OUTPUT:

RESULT:
The progress is excuted sucessfully
SOURCE CODE:
print("Name = S.Roshan")

print("Roll no = 11413")

for a in range(1,100):

if a%3==0:

print("Fizz")

elif a%5==0:

print("Buzz")

elif a%3==0 and a%5==0:

print("Fizz Buzz")

OUTPUT:
RESULT:
The progress is excuted sucessfully
SOURCE CODE:
print("Name = S.Roshan")

print("Roll no = 11413")

N=int(input("Enter how many in the list:"))

B=[]

for I in range(0,N):

A=int(input("Enter any element"))

B.append(A)

S1=S2=S3=0

for C in B:

if C>0:

if C%2==0:

S1+=C

else:

S2+=C

else:

S3+=C

print('Sum of Positive Even number:',S1)

print('Sum of Positive Odd number:',S2)

print('Sum of Negative numbers:',S3)

print(B)
OUTPUT:

RESULT:
The progress is excuted sucessfully
SOURCE CODE

print("Name = S.Roshan")

print("Roll no = 11413")

N=int(input('Enter the number:'))

value1=0

value2=1

Result=0

print(value1)

print(value2)

for A in range(0,N):

Result=(value1+value2)

value1=value2

value2=Result

print(Result)

OUTPUT:
RESULT:
The progress is excuted sucessfully
SOURCE CODE:
print("Name= S.Roshan")

print("Rollno=11413")

print("Class= 11-D")

A=eval(input('Enter the list:'))

print('The min value is',min(A))

print('The max value is',max(A))

print(A)

OUTPUT:

RESULT:
The progress is excuted sucessfull
SOURCE CODE:
print("Name = S.Roshan")

print("Roll no = 11413")

print("Class= 11-D")

A=input('Enter the name:')

B=int(input('Enter the account number:'))

C=input('Enter your Branch:')

D=float(input('Enter your current balance:'))

print('''Deposit=1

Withdrawal=2

Balance Enquiry=3''')

G=1

while G==1:

CO=int(input('Enter your choice:'))

if CO==1:

E=float(input('Enter the amount you want to Despoit:'))

D+=E

print('Your current balance is:',D)

elif CO==2:

F=float(input('Enter the amount you want to Deposit:'))

D-=F

print('Your current Balance is:',D)

elif CO==3:
print('Your name:',A)

print('Your account number:',B)

print('Your Bank Branch:',C)

print('Your bank balance:',D)

else:

print('Enter a valid choice!')

G=int(input('If you need to run it again press(1):'))

OUTPUT:
RESULT:
The progress is excuted sucessfull
SOURCE CODE:
print("Name = S.Roshan")

print("Roll no = 11413")

print("Class= 11-D")

A=int(input('Enter a number:'))

B=1

C=1

while C<=A:

B*=C

C+=1

print('The factorial of ',A,':',B)

OUTPUT:
RESULT:
The progress is excuted sucessfull
SOURCE CODE:
print("Name = S.Roshan")

print("Roll no = 11413")

print("Class= 11-D")

A=eval(input('Enter the mark of a 1st student like (1st sub mark ,2nd sub mark, 3rd sub
mark):'))

B=eval(input('Enter the mark of a 2nd student like (1st sub mark ,2nd sub mark, 3rd sub
mark):'))

C=eval(input('Enter the mark of a 3rd student like (1st sub mark ,2nd sub mark, 3rd sub
mark):'))

D=eval(input('Enter the mark of a 4th student like (1st sub mark ,2nd sub mark, 3rd sub
mark):'))

E=eval(input('Enter the mark of a 5th student like (1st sub mark ,2nd sub mark, 3rd sub
mark):'))

Marks=(A,B,C,D,E)

print('Marks:',Marks)

OUTPUT:
RESULT:
The progress is excuted sucessfull
SOURCE CODE:
print("Name = S.Roshan")

print("Roll no = 11413")

print("Class= 11-D")

A=int(input('Enter a number:'))

C=A**3

D=1

for B in range(1,A+1):

if A%B==0:

D*=B

if D==C:

print('It is a Fisher number:')

else:

print('It is not a Fisher number:')

print(C)

OUTPUT:
RESULT:
The progress is excuted sucessfull
SOURCE CODE:
print("Name = S.Roshan")

print("Roll no = 11413")

print("Class= 11-D")

L=eval(input('Enter a list:'))

Length=len(L)

Mean=sum=0

for I in range(0,Length-1):

sum+=L[I]

Mean=sum/Length

print("The list is :",L)

print("The mean is :",Mean)


SOURCE CODE:
SOURCE CODE:

You might also like