Java, .NET, PHP, PYTHON, ANGULAR, ML, Data Science, Testing, CI Tutorials in Easy Languages.

"Best Software Training, Internship, Project Development center of Indore India, Helpline 780506-3968"

Python Installation






1) PYTHON IDLE INSTALLATION Using Python .exe file


Python will be installed using two different ways


1) Offline using Python IDLE


2) Online using Jupyter



1)  Offline installation using IDLE:-


Step1st:-


We can Install Python easily go into www.python.org and click on downloads and download python.exe file, double click it, and install it.


https://www.python.org/downloads


for window 7 and before windows 7 o/s:-  Python 2.7 version should be installed.

After this version, we can install Python 3:



Step2nd:-


Open Python IDLE (Integrated Development Learning Environment)

By Default IDLE Provide Terminal mode which is for instant script execution for System administrator 


step3rd:-

Click on File---> New File Option---> Write Python Script

print("Welcome in Python Script")
print("It is a script-based programming language which was created by GUIDO VAN RASSUM")


step4th:-


Save this file using the .py extension and click on the run option or press the F5 button.



Q) Write a program to calculate Simple Interest?

p=450000
r = 7.5
t =10
si = (p*r*t)/100
A = p+si

print("Total amount will be ",A)      
print("Total interest will be ",si)


The solution of the SI program using the format():-

princ,rate,time = 25000,2,3  #multiple variable declration
si = (princ*rate*time)/100   #formula of SI
#print(si)                    #display output
#print("result of si is ",si)
print("result is princ={0}, rate={1} and time={2} and result={3}".format(princ,rate,time,si))



Write a program to perform the addition of two numbers?

a=100
b=200
c=a+b
print(c)

....................
........................................................................................................................................

2) Online using Jupyter

PYTHON INSTALLATION USING JUPYTER ONLINE TOOLS:-

Jupyter provides a Jupyter notebook that provides a completely online platform where we can easily execute Python Script Online.
We can execute python scripts on mobile applications also.




.......................................................................................................................................................



1)open browser and type jupyter.org/try

https://jupyter.org/try


2)
Click on the Try Jupyter Lab menu option


3) IT will redirect to Jupyter notebook with Jupyter Lab option


4)  Click on Python3 it will open the Jupyter notebook block


5)  Write code and execute this



WAP to SWAP Two numbers using Third Variable?

Solution 1:-

a=10
b=20
print(a,b)
temp=a
a=b
b=temp
print(a,b)


Solution 2:-

a=10
b=20
print("before swap a={0} and b={1}".format(a,b))
temp = a
a=b
b=temp
print("after swap a={0} and b={1}".format(a,b))

WAP to SWAP WITHOUT UISNG Third Variable?

a=10
b=20
a,b = b,a
print("a=",a," b= ",b)







ASSIGNMENT:-


WAP to reverse the three-digit number?  123  or 321

Solution:-

a=123
print(a)
num1 = a%10  #3
a =(int)(a/10)   #12
num2 = a%10 #2
num3 = a//10 #1
res = num1*100+num2*10+num3*1
print(res)

WAP to display the middle number is a three-digit number?  a 145,154,451   

WAP to calculate Square and Cube of any assigned number?




8 Comments

If you have any doubt in programming or join online classes then you can contact us by comment .

  1. wap find square and cube of number
    a=5
    print(a*a)
    print(a*a*a)

    ReplyDelete
  2. swap of two number using third variable in jupyter
    a=10
    b=20
    print("before swap")
    print(a,b)
    temp=a
    a=b
    b=temp
    print("after swap")
    print(a,b)

    ReplyDelete
  3. reverse number
    a=123
    print(a)
    num1=a%10
    a=(int)(a/10)
    num2=a%10
    num3=a//10
    res=num1*100+num2*10+num*1
    print(res)

    ReplyDelete
  4. Lokesh Rathore

    Find the Middle number among three numbers
    Solution :-
    a = 145
    b=a%10
    a=a//10
    b=a%10
    print(b)

    ReplyDelete
  5. Lokesh Rathore

    Square & Cube of any Number
    Solution:-
    a=5
    b=a*a
    c=a*a*a
    print("The Square of 5 is ",b)
    print("The Cube of 5 is ",c)

    ReplyDelete
  6. Lokesh Rathore

    Reverse the Three Digit Number
    Solution:-
    a = 145
    print("Number Beforte Reverse :- ",a)
    b=a%10
    a=a//10
    c=a%10
    d=a//10
    e=b*100+c*10+d*1
    print("Number After Reverse :- ",e)

    ReplyDelete
  7. #PYTHON (6 To 7 PM BATCH)
    #To calculate Square and Cube of any assigned number.
    z = int(input("Enter The No. :\t"))
    z1 = int(input("For Square Press 2 or Press 3 for Cube :\t"))

    if z1==2:

    print(z**z1)
    elif z1 ==3:

    print(z**z1)

    else:
    print("Entered wrong Value")

    ReplyDelete

Post a Comment

If you have any doubt in programming or join online classes then you can contact us by comment .

Previous Post Next Post