| Sr.No | Assignment name |
|---|---|
| Set-A | |
| 1 |
Write python script to calculate sum of digits of a given input number. Plz Click on Question to see Answern=int(input("Enter number:")) s=0 while n>0: d=int(n%10) s=s+d n=int(n/10) print("sum of digit=",s) |
| 2 |
Write python script to check whether a input number is Armstrong number or not. Plz Click on Question to see Answern=int(input("Enter number:")) n1=n s=0 while n>0: d=int(n%10) s=s+d*d*d n=int(n/10) if n1==s: print("Number is armstrong") else: print("Number is not armstrong") |
| 3 |
Write python script to check whether a input number is perfect number of not. Plz Click on Question to see Answern=int(input("Enter number:")) s=0 for i in range(1,n): if n%i==0: s=s+i if s==n: print("Number is perfect") else: print("Number is not perfect") |
| 4 |
Write a program to calculate XY Plz Click on Question to see Answern1=int(input("Enter Base Element:")) n2=int(input("Enter Exponent Element:")) ans=n1**n2 print("Base to Power=",ans) |
| 5 |
Write a program to check whether a input number is palindrome or not. Plz Click on Question to see Answern=int(input("Enter number:")) n1=n r=0 while n>0: d=int(n%10) r=r*10+d n=int(n/10) if n1==r: print("Number is palindrome") else: print("Number is not palindrome") |
| 6 |
Write a program to calculate sum of first and last digit of a number. Plz Click on Question to see Answern=int(input("Enter number:")) id=n%10 while n>0: d=int(n%10) n=int(n/10) print("Sum of First & Last digit=",id+d) |
| Set-B | |
| 1 |
Write a program to accept a number and count number of even,odd, zero digits within that number. Plz Click on Question to see Answern=int(input("Enter number:")) even=0 odd=0 zero=0 while(n>0): d=int(n%10) n=int(n/10) if(d%2==0): even+=1 if(d%2!=0): odd+=1 if(d==0): zero+=1 print("Even digit count=",even) print("odd digit count=",odd) print("zero digit count=",zero) |
| 2 |
Write a program to accept a binary number and convert it into decimal number. Plz Click on Question to see Answerbno=input("ENter a Binary No:") dno=int(bno,2) print("Decimal of {p}={q}".format(p=bno,q=dno)) |
| 3 |
Write a program which accepts an integer value as command line and print “Ok” if value is between 1 to 50 (both inclusive) otherwise it prints ”Out of range”. Plz Click on Question to see Answern=int(input("Enter number:")) if n>=1 and n<=50: print("okk") else: print("out of range") |
| 4 |
Write a program which accept an integer value ‘n’ and display all prime numbers till ‘n’. Plz Click on Question to see Answern=int(input("Enter Limit:")) print("All prime numbers:") for no in range(1,n): f=0 for i in range(2,no): if no%i==0: f=1 if f==0: print(no,end=" ") |
| 5 |
Write python script to accept two numbers as range and display multiplication table of all numbers within that range. Plz Click on Question to see Answera=int(input("Enter NO 1:")) b=int(input("Enter NO 2:")) for i in range(1,11): for j in range(a,b+1): print(j*i,end=" ") print(" ") |
| Set-C | |
| 1 |
Write a python script to generate the following pattern upto n lines. 1 1 2 1 1 2 3 2 1 1 2 3 4 3 2 1 Plz Click on Question to see Answern=int(input("Enter Limit")) for i in range(1,n): for j in range(n,i,-1): print(" ",end=" ") for j in range(1,i+1): print(j,end=" ") for k in range(j-1,0,-1): print(k,end=" ") print(" ") |
- Home
- SYLLABUS
- _FYBBA(CA)
- __DBMS
- __WEB TECHNOLOGY
- _SYBBA(CA)
- __PHP
- __ADVANCE PHP
- _TYBBA(CA)
- __CORE JAVA
- __ADVANCE JAVA
- NOTES
- _Database System
- __CHAPTER1
- __CHAPTER 2
- _Web Technology
- __Chapter-1
- __Chapter-2
- __Chapter-3
- _Advance PHP
- __Chapter-1
- __Chapter-2
- __Chapter-3
- Research
- About us
- Assignment
- certificate
- Solved Programs
- Problem
- _Lab Book
- _Practical Slips
- _Assignment Submit
- _Project Guideline
- __SYBBACA SEM-IV
- __TYBBACA SEM-V
- __TYBBACA SEM-VI
- _C language
- __Simple Program
- __Simple Program
0 Comments