├── .github └── workflows │ └── jekyll-gh-pages.yml ├── README.md ├── p.rpm ├── p1.rpm ├── p2.rpm ├── p3.rpm ├── p4.rpm ├── p5.rpm ├── p6.rpm ├── p7.rpm ├── p8.rpm ├── python1.exe ├── slip-1 ├── slip-2 └── slip-3 /.github/workflows/jekyll-gh-pages.yml: -------------------------------------------------------------------------------- 1 | # Sample workflow for building and deploying a Jekyll site to GitHub Pages 2 | name: Deploy Jekyll with GitHub Pages dependencies preinstalled 3 | 4 | on: 5 | # Runs on pushes targeting the default branch 6 | push: 7 | branches: ["main"] 8 | 9 | # Allows you to run this workflow manually from the Actions tab 10 | workflow_dispatch: 11 | 12 | # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages 13 | permissions: 14 | contents: read 15 | pages: write 16 | id-token: write 17 | 18 | # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. 19 | # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. 20 | concurrency: 21 | group: "pages" 22 | cancel-in-progress: false 23 | 24 | jobs: 25 | # Build job 26 | build: 27 | runs-on: ubuntu-latest 28 | steps: 29 | - name: Checkout 30 | uses: actions/checkout@v3 31 | - name: Setup Pages 32 | uses: actions/configure-pages@v3 33 | - name: Build with Jekyll 34 | uses: actions/jekyll-build-pages@v1 35 | with: 36 | source: ./ 37 | destination: ./_site 38 | - name: Upload artifact 39 | uses: actions/upload-pages-artifact@v2 40 | 41 | # Deployment job 42 | deploy: 43 | environment: 44 | name: github-pages 45 | url: ${{ steps.deployment.outputs.page_url }} 46 | runs-on: ubuntu-latest 47 | needs: build 48 | steps: 49 | - name: Deploy to GitHub Pages 50 | id: deployment 51 | uses: actions/deploy-pages@v2 52 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PYTHON-PROGRAMS -------------------------------------------------------------------------------- /p.rpm: -------------------------------------------------------------------------------- 1 | import math 2 | a=int(input("enter number")) 3 | b=int(input("enter number")) 4 | c=a+b 5 | print("addition=",c) 6 | -------------------------------------------------------------------------------- /p1.rpm: -------------------------------------------------------------------------------- 1 | a=int(input("enter first number")) 2 | b=int(input("enter second number")) 3 | c=int(input("enter third number")) 4 | if a>b and a>c: 5 | print("first number greater",a) 6 | elif b>c and b>a: 7 | print("second number greater",b) 8 | elif c>a and c>b: 9 | print("third number greater",c) 10 | else: 11 | print("numbers are same") 12 | -------------------------------------------------------------------------------- /p2.rpm: -------------------------------------------------------------------------------- 1 | import math 2 | r=float(input("enter radius")) 3 | a=3.14*r*r 4 | p=2*3.14*r 5 | print("Area of circle=",a) 6 | print("Perimeter of circle=",p) 7 | -------------------------------------------------------------------------------- /p3.rpm: -------------------------------------------------------------------------------- 1 | n=input("enter limit") 2 | n=int(n) 3 | a=[] 4 | for i in range(0,n): 5 | s1=input("enter names") 6 | a.append(s1) 7 | x=input("enter name to search") 8 | if x in a: 9 | print("found") 10 | else: 11 | print("not found") 12 | -------------------------------------------------------------------------------- /p4.rpm: -------------------------------------------------------------------------------- 1 | a=input("enter limit") 2 | a=int(n) 3 | a=[] 4 | for i in range(0,n): 5 | num=int(input("enter numbers")) 6 | a.append(num) 7 | print("numbers=",a) 8 | x=int(input("enter n numbers")) 9 | if x in a: 10 | print("found") 11 | else: 12 | print("not found") 13 | -------------------------------------------------------------------------------- /p5.rpm: -------------------------------------------------------------------------------- 1 | 1. s=input("enter string") 2 | for i in range(0,len(s)+1): 3 | print(s[:i]) 4 | 5 | output:= 6 | v 7 | va 8 | vai 9 | vais 10 | vaish 11 | vaishu 12 | 13 | 14 | 15 | 2. s=input("enter string") 16 | for i in range(0,len(s)-1): 17 | print(s[0:]) 18 | 19 | output:= 20 | vaishu 21 | vaishu 22 | vaishu 23 | vaishu 24 | vaishu 25 | -------------------------------------------------------------------------------- /p6.rpm: -------------------------------------------------------------------------------- 1 | 2 | n=int(input("enter limit")) 3 | a=[] 4 | for i in range(n): 5 | num=int(input("enter 1 by 1 number")) 6 | a.append(num) 7 | print("numbers=",a) 8 | print("maximum number in array=",max(a)) 9 | 10 | 11 | 12 | 13 | n=int(input("enter limit")) 14 | a=[] 15 | for i in range(n): 16 | num=int(input("enter 1 by 1 number")) 17 | a.append(num) 18 | print("numbers=",a) 19 | print("minimum number in array=",min(a)) 20 | -------------------------------------------------------------------------------- /p7.rpm: -------------------------------------------------------------------------------- 1 | n=int(input("enter limit")) 2 | a=[] 3 | for i in range(n): 4 | num=int(input("enter 1 by 1 number")) 5 | a.append(num) 6 | print("maximum number in array=",min(a)) 7 | -------------------------------------------------------------------------------- /p8.rpm: -------------------------------------------------------------------------------- 1 | n=input("enter limit") 2 | n=int(n) 3 | a=[] 4 | for i in range(n): 5 | num=int(input("enter 1 by 1")) 6 | a.append(num) 7 | print("numbers=",a) 8 | a.sort() 9 | print("ascending=",a) 10 | 11 | 12 | 13 | 14 | 15 | n=input("enter limit") 16 | n=int(n) 17 | a=[] 18 | for i in range(n): 19 | num=int(input("enter 1 by 1")) 20 | a.append(num) 21 | print("numbers=",a) 22 | a.reverse() 23 | print("ascending=",a) 24 | -------------------------------------------------------------------------------- /python1.exe: -------------------------------------------------------------------------------- 1 | Python 3.11.4 (tags/v3.11.4:d2340ef, Jun 7 2023, 05:45:37) [MSC v.1934 64 bit (AMD64)] on win32 2 | Type "help", "copyright", "credits" or "license()" for more information. 3 | >>> a=10 4 | >>> b=8 5 | >>> a+b 6 | 18 7 | >>> a-b 8 | 2 9 | >>> a/b 10 | 1.25 11 | >>> a%b 12 | 2 13 | >>> a*b 14 | 80 15 | >>> a**b 16 | 100000000 17 | >>> a=[10,22,33] 18 | >>> type(a) 19 | 20 | >>> a={11,22,33} 21 | >>> type(a) 22 | 23 | -------------------------------------------------------------------------------- /slip-1: -------------------------------------------------------------------------------- 1 | Q.1 2 | a] 3 | print("hello,world") 4 | 5 | b] 6 | print(2+3) 7 | 8 | c] 9 | from math import* 10 | 4.0/10.0+3.5*2 11 | 12 | d] 13 | from math import* 14 | sqrt((3.5-5.0)+7*3) 15 | 16 | e] 17 | a=5 18 | print(type(a)) 19 | 20 | f] 21 | pi=3.14 22 | print(type(pi)) 23 | 24 | g] 25 | name='python' 26 | print(type(name)) 27 | 28 | h] 29 | q=True 30 | print(type(q)) 31 | 32 | i] 33 | 2+5 34 | 35 | j] 36 | (2/5)+4/5-(7*5)/5 37 | 38 | k] 39 | 17%5 40 | 41 | Q.2 42 | a] 43 | import random 44 | print(random.randint(1,10)) 45 | 46 | b] 47 | import random 48 | print(random.randint(1,100)) 49 | 50 | c] 51 | def f(r): 52 | c=2*pi*r 53 | print(c) 54 | 55 | d] 56 | from math import* 57 | ue=230 58 | Amplitude=ue*sqrt(2) 59 | print(Amplitude) 60 | 61 | e] 62 | def f(n): 63 | print('square=',n*n) 64 | 65 | f] 66 | def f(x): 67 | a=sin(x) 68 | b=cos(x) 69 | c=tan(x) 70 | print('sin(x)=',a) 71 | print('cos(x)=',b) 72 | print('tan(x)=',c) 73 | 74 | g] 75 | def f(x,y,z): 76 | a=x+y+z 77 | b=x*y*z 78 | print("sum=",a) 79 | print("product=",b) 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /slip-2: -------------------------------------------------------------------------------- 1 | Q.1 2 | def f(a,b): 3 | q=a//b 4 | r=a%b 5 | print("quotient=",q) 6 | print("remainder=",r) 7 | Q.2 8 | from math import* 9 | def circle(r): 10 | a=pi*r**2 11 | c=2*pi*r 12 | print("area of circle=",a) 13 | print("area of circumference=",c) 14 | Q.3 15 | from cmath import* 16 | def f(a,b,c): 17 | r=-b/(2*a) 18 | i=sqrt(b*b-4*a*c)/(2*a) 19 | print("roots=",r+i,',',r-i) 20 | Q.4 21 | A] 22 | x=True 23 | y=True 24 | z=x and y 25 | print(z) 26 | 27 | B] 28 | x=True 29 | y=False 30 | z=x and y 31 | print(z) 32 | 33 | C] 34 | x=False 35 | y=True 36 | z=x and y 37 | print(z) 38 | 39 | D] 40 | x=False 41 | y=False 42 | z=x and y 43 | print(z) 44 | 45 | E] 46 | x=False 47 | y=False 48 | z=x and y 49 | print(z) 50 | 51 | Q.5 52 | x=False 53 | y=False 54 | z=(x or y)and(not x or not y) 55 | print(z) 56 | 57 | Q.6 58 | A] 59 | x=True 60 | y=True 61 | z=False 62 | p=(x or y)and z 63 | print(p) 64 | 65 | B] 66 | x=True 67 | y=True 68 | z=False 69 | p=(x and not y)or(x and z) 70 | print(p) 71 | 72 | C] 73 | x=True 74 | y=True 75 | z=False 76 | p=(x and y)or not z 77 | print(p) 78 | 79 | -------------------------------------------------------------------------------- /slip-3: -------------------------------------------------------------------------------- 1 | Q.1 2 | s1='Welcome' 3 | s2='to' 4 | s3='Python' 5 | len(s1) 6 | 7 7 | s1+s2 8 | 'Welcometo' 9 | 10 | s1[0] 11 | 'W' 12 | 13 | s1[2:5] 14 | 'lco' 15 | 16 | s3[-1]+s1[3] 17 | 'nc' 18 | 19 | s3[2:] 20 | 'thon' 21 | 22 | s3[:4] 23 | 'Pyth' 24 | 25 | s1[1:6:2] 26 | 'ecm' 27 | 28 | Q.2 29 | s1='hello' 30 | s2='everyone' 31 | s3='[1,2,3]' 32 | 33 | 3*s1 34 | 'hellohellohello' 35 | 36 | s3=[1,2,3] 37 | s3.append(4) 38 | print(s3) 39 | [1, 2, 3, 4] 40 | 41 | print(s1+s2) 42 | helloeveryone 43 | 44 | Q.3 45 | i=[1,2,3,4,5] 46 | print(i) 47 | [1, 2, 3, 4, 5] 48 | print(len(i)) 49 | 5 50 | 51 | Q.4 52 | d=[1,2,6,7,6,8,9,5,4] 53 | print(d) 54 | [1, 2, 6, 7, 6, 8, 9, 5, 4] 55 | d[1] 56 | 2 57 | d[5] 58 | 8 59 | d[6] 60 | 9 61 | 62 | Q.5 63 | a=[1,2,3] 64 | b=[4,5,6] 65 | a+b 66 | [1, 2, 3, 4, 5, 6] 67 | 2*a 68 | [1, 2, 3, 1, 2, 3] 69 | 70 | Q.6 71 | t1=('m','u','m','b','a','i') 72 | t2=('p','u','n','e') 73 | t1[-2] 74 | 'a' 75 | t1[:4] 76 | ('m', 'u', 'm', 'b') 77 | t1[1:] 78 | ('u', 'm', 'b', 'a', 'i') 79 | t1[1:]+t2[:1] 80 | ('u', 'm', 'b', 'a', 'i', 'p') 81 | t2*2 82 | ('p', 'u', 'n', 'e', 'p', 'u', 'n', 'e') 83 | 84 | Q.7 85 | t1=(5,78,8,90,1,3) 86 | sorted(t1) 87 | [1, 3, 5, 8, 78, 90] 88 | 89 | Q.8 90 | t1=(11,22) 91 | t2=(33,44) 92 | t1,t2=t2,t1 93 | print(t1) 94 | (33, 44) 95 | 96 | 97 | 98 | --------------------------------------------------------------------------------