Python Introduction:-

68



Python is a high-level script-based language that contains the
only interpreter to execute a python script.
Script-based language means the language that will be executed by the Interpreter. The interpreter will execute the code line by line, Script-based language does not contain any separate compiler to convert the code. the compiler will be in-built under the interpreter.
PHP,  PYTHON,  RUBY,  JS,  JQUERY,  ANGULAR,  NODE,  REACT all are script-based languages.
Initially, a Python script was developed to create a device driver-based software system for the different operating systems.
But now  Python is complete technology or platform which contain multiple library, framework, and support to create application software.
using Python script We can create the following application.
1 Desktop Application:-  
This type of application will be installed separately on each machine. without using the internet this type of software will work.
 Similar to Notepad, MS-OFFICE, Antivirus, FIREWALL, Billing System.
Technology:-   TKINTER, PYQT
2 WEB APPLICATION:- the application that will be executed by the Internet or Intranet is called a Web application.
example  Youtube, Twitter
Framework -    Django, Pyramid, Flask
3 Mobile Application:-  Python provides touch panel-based UI implementation using the KIVY framework.
Twitter, Instagram
Framework:-  KIVY
4 Data Science:-  for data analysis, data engineering, Data visualization, Data Operation
Library:-  SCIPY, NUMPY, MATPLOTLIB, PANDA, PANDAS,
5 Machine Learning:-  Dynamic programming of Data Science
Tools:-  SCI-KIT LEARN
6 IoT based application:-  Internet of things, Home automation
7 Cloud-Based application:-  Cloud means an open platform that can provide common accessibility to user's from any device.
Python support all popular cloud platform
AWS, Microsoft AZURE,  Google Cloud, etc 
8 Game-based application
Pygame  library for game development
pygame library is used to create a Python Game application.
9 Device Driver:-  wi-fi, Bluetooth, sensor
10 Firewall & Security
ASSIGNMENTS:-
WAP to calculate difference of two date in year, date should be assigned on ddmmyyyy 
12052016
13062019
o/p  2019-2016  3
WAP to calculate the sum of all digits in date of birth?
WAP to Convert feet to inch and inch to feet?
WAP to convert km to meter?
WAP to convert decimal to binary?
WAP to calculate basic, ta, da, comm, pf,  HRA, Leave, numberofleave will be entered by the users?
basic = 5000
ta = basic*(2/100)
da = basic*(5/100)
comm = basic*(5/100)
emppf =  basic*(8.33/100)
employerpf = basic*(3.67/100)
hra = basic*(10/100)
advancesal=500
nl =3
tsal = basic+ta+da+comm
leave = tsal/30
ctc = basic+ta+da+comm+emppf+hra
grosssal = tsal - emppf - (nl-1)*leave-advancesal
print("Package is ",12*ctc)
print("Gross salary is ",grosssal)
print("Leave Deduction days ",nl-1," and amount is ",(nl-1)*leave)
print("Pf Deduction is ",emppf)
print("Ta is ",ta,"\n da is ",da, "\n comm is ",comm,"\n hra is ",hra,"\n Advance Salary is ",advancesal)
Tags

إرسال تعليق

68تعليقات

POST Answer of Questions and ASK to Doubt

  1. number = 123
    rev_num = 0
    while (number > 0) :
    rev_num = (rev_num*10) + number%10
    number = (int)(number/10)
    print(rev_num)

    ردحذف
  2. This program should be created without loop and if use loop then use indentation

    ردحذف
  3. num =123
    a = num%10 #3
    num= num//10 #12
    b= num%10 #2
    c=num//10 #1
    rev = a*100+b*10+c*1
    print(rev)

    ردحذف
  4. What is Interpreter and script both are same?

    ردحذف
  5. Program of Compund Interest?

    p=1000000
    r=7.5
    t=20
    n=12
    R = r/100
    ci= p*((1+R/n)**(n*t))
    print("Total amount including interest is ",ci,"\n interest ",(ci-p))

    ردحذف
  6. # area of traingle

    l=int(input("enter length value=") )
    b=int(input("enter breath value="))
    area=1/2*l*b
    Print("enter length value=" , "enter breath value= , area)


    ردحذف
  7. #reverse number using While loop

    number=123
    rev_num=0

    while(number>0):
    rev_num=(rev_num*10)+number%10
    number=(int)(number/10)
    print(rev_num)

    ردحذف
  8. #compount interest program

    p=15000
    r=7.5
    t=3
    n=12

    R=r/100
    ci=p*((1+R/n)**(n*t))

    print("Total ammount including interest is ",ci,"/n interest",(ci-p))


    ردحذف
  9. # Difference between two date in year
    # created by Shiva
    firstdate = int("02061998") #ddmmyyyy
    lastdate = int("03072021")

    f1 = firstdate%10000
    print(f1)
    f2 = lastdate%10000
    print(f2)

    year = f2-f1

    print(year)

    ردحذف
  10. #Program of Compund Interest

    p=1000000
    r=7.5
    t=20
    n=12
    R = r/100
    ci= p*((1+R/n)**(n*t))
    print("Total amount including interest is ",ci,"\n interest ",(ci-p))

    ردحذف
  11. # area of traingle

    l=int(input("enter length value=") )
    b=int(input("enter breath value="))
    area=1/2*l*b
    Print("enter length value=" , "enter breath value= , area)

    ردحذف
  12. # Difference between two date in year

    firstdate = int("02061998") #ddmmyyyy
    lastdate = int("03072021")

    f1 = firstdate%10000
    print(f1)
    f2 = lastdate%10000
    print(f2)

    year = f2-f1

    print(year)

    ردحذف
  13. #wap find square and cube of number

    a=5
    print(a*a)
    print(a*a*a)

    ردحذف
  14. #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)

    ردحذف
  15. #reverse 5 digits number without loop
    mun=int(input("enter any number:-"))
    a=mun%10
    mun=mun//10
    b=mun%10
    mun=mun//10
    c=mun%10
    mun=mun//10
    d=mun%10
    mun=mun//10
    e=mun%10
    mun=mun//10
    print(a,b,c,d,e)

    ردحذف
  16. #WAP to display the middle number is a three-digit number?

    a=int(input("enter the value"))
    b=int(input("enter the second value"))
    c=a%10
    a=a//10
    c=a%10
    d=b%10
    b=b//10
    d=b%10
    print("the first mid no is",c ,"the second mid no is",d)

    ردحذف
  17. #WAP to calculate Square and Cube of any assigned number.
    a=int(input("enter number for square and cube"))
    square=(a*a)
    print("the assgined square is",square)
    cube=(a*a*a)
    print("the Assgined cube is",cube)

    ردحذف
  18. #Area of Tringle
    b=10
    h=20
    Area=(b*h)/
    /2
    print(Area)

    ردحذف
  19. #Adding complex number using complex number

    A=2+4J
    B=4+5J
    c=A+B
    print(A)
    print(B)
    print("addition of complex number", c)
    print(c)

    ردحذف
  20. #convert temperature from Celsius to Fahrenheit?
    '''formula --> fahrenheit = (celsius * 1.8) + 32'''

    celsius=float(input(" Temperature in Celsius : "))
    fahrenheit=(celsius*1.8)+32
    print("{0} degree Celsius is equal to {1} degree Fahrenheit".format (celsius,fahrenheit))

    ردحذف
  21. #calculate Simple Interest where rate and time will be constant and
    the principal will be an integer

    CONST = (2.5,4.5)
    p=450000
    si = (p*CONST[0]*CONST[1])/100
    print(si)

    ردحذف

  22. #Program to calculate AREA of Triangle,RECT and CIRCLE?

    CONST = (3.14,200,50)
    r = 5
    height=20
    width=300
    areaOfCircle = CONST[0]*r*r
    areaOfTriangle = (CONST[1]*height)/2
    areaOfRectangle = width*CONST[2]
    print("Area of Cirlce is",areaOfCircle)
    print("Area of Triangle is",areaOfTriangle)
    print("Area of Rectangle is ",areaOfRectangle)

    ردحذف
  23. #calculate the total salary of an employee where basic, ta, da, comm, pf,hra, leave will be entered by the users

    basic_salary = int(input("enter ur basic salary: "))
    ta = int(input("enter ur ta: "))
    da = int(input("enter ur da: "))
    comm = int(input("enter ur comm: "))
    pf = int(input("enter ur pf amount: "))
    num_of_leave = int(input("enter ur num of leave: "))

    leave_amount = num_of_leave*((basic_salary+ta+da+comm+pf)/30)
    net_salary =basic_salary + ta + da + comm + pf - leave_amount
    print("ur net salary=",net_salary)

    ردحذف
  24. #WAP to evaluate the middle number in three-digit numbers based on order?

    x = int(input("Enter 3 digit number = "))
    a = x % 100
    b = a // 10
    print("Middle number is = ",b)

    ردحذف
  25. #multiplication of a complex number:-
    a=2+5j
    b=4+6j
    print("a=",a)
    print("b=",b)
    c=(a*b)
    print("multiplication of a complex number:",c)

    ردحذف
  26. #WAP to calculate difference of two date in year.

    fstdate=int(input("enter the first date of birth in ddmmyyyy"))
    lstdate=int(input("enter last date of birth in ddmmyyyy"))
    f1=fstdate%10000
    f2=lstdate%10000
    year=(f1-f2)
    print("%d" % year)

    ردحذف
  27. #WAP to calculate sum of all digit in date of birth.
    num=int(input("enter dob in form of ddmmyyyy"))
    a=num%10000
    num1=num//10000
    b=num1%100
    num2=num1//100
    c=num2%10
    sum=a+b+c
    print(sum)

    ردحذف
  28. #WAP to Convert feet to inch and inch to feet?
    #inch==feet*12
    feet=float(input("enter the value"))
    inch=feet*12
    print("the value of inch is ",inch)

    ردحذف
  29. # WAP to convert km to meter?
    #1km=1000 meters
    km=float(input("enter km"))
    meter=km*1000
    print("the value in meter is ",meter)

    ردحذف
  30. #WAP to Convert to inch to feet .
    #feet==inch/12
    inch=float(input("enter the value of inch"))
    feet=inch/12
    print("the convertion inch to feet is ",feet)

    ردحذف
  31. #WAP to Convert to inch to feet .
    #feet==inch/12
    inch=float(input("enter the value of inch"))
    feet=inch/12
    print("the convertion inch to feet is ",feet)

    ردحذف
  32. #WAP to calculate difference of two date in year.
    firstdate=12052017
    nowdate=28092021
    f1= (firsdate%1000)
    print (f1)
    f2=(nowdate%1000)
    print (f2)
    year=f2-f1
    print(year)

    ردحذف
  33. #WAP to convert km to meret .
    km=int(input("enter km"))
    meter=km*1000
    print(meter)

    ردحذف
  34. #addition of dob of yash
    dob=10091997
    a=dob%10 #7
    dob=dob//10 #1009199
    b=dob%10 #9
    dob=dob//10 #100919
    c=dob%10 #9
    dob=dob//10 #10091
    d=dob%10 #1
    dob=dob//10 #1009
    e=dob%10 #9
    dob=dob//10 #100
    f=dob%10 #0
    dob=dob//10 #10
    g=dob%10 #0
    dob=dob//10 #1
    h=dob%10
    dob=dob//10
    print(a+b+c+d+e+f+g+h)
    #output is 36

    ردحذف
  35. #WAP to convert km to meret .
    km=int(input("enter km"))
    meter=km*1000
    print(meter)

    ردحذف
  36. #WAP to convert km to meret .
    km=int(input("enter km"))
    meter=km*1000
    print(meter)

    ردحذف
  37. # difference of two date in year

    pritesh=int("01111997")
    shlok=int("25111999")
    p=pritesh%10000
    s=shlok%10000
    diff=s-p
    print("Difference of two date in year is:",diff)

    ردحذف
  38. # sum of DOB

    p=int("12111997")
    a=p%10 #7
    p=p//10 #1211199
    b=p%10 #9
    p=p//10 #121119
    c=p%10 #9
    p=p//10 #12111
    d=p%10 #1
    p=p//10 #1211
    e=p%10 #1
    p=p//10 #121
    f=p%10 #1
    p=p//10 #12
    g=p%10 #2
    p=p//10 #1
    print("Sum of dob is ",a+b+c+d+e+f+g+p)

    ردحذف
  39. # conversion into km to meter
    a=float(input("Enter distance in KM:"))
    M=1000*a
    print(M)

    ردحذف
  40. convert decimal to binary
    a=bin(5)
    print(a)

    ردحذف
  41. #program to calculate difference between two dates in year
    date1 = int(input("Enter First Date in ddmmyyyy"))
    date2 = int(input("Enter Last Date in ddmmyyyy"))
    y1=date1 % 10000
    y2=date2 % 10000

    diff = y2-y1
    print("Difference between two date in year is ",diff)

    ردحذف
  42. #program to calculate sum of all digit in dob

    dob = int(input("Enter date of birth in ddmmyyyy"))
    a = dob%10 # 2
    dob = dob//10 # 1001199
    b = dob%10 # 9
    dob = dob//10 #100119
    c = dob%10 #9
    dob = dob//10 #10011
    d = dob%10 #1
    dob = dob//10 #1001
    e = dob%10 #1
    dob = dob//10 #100
    f = dob%10 #0
    dob = dob//10 #10
    g = dob%10 #0
    h = dob//10 #1
    s = a+b+c+d+e+f+g+h
    print(s)

    ردحذف
  43. 1.WAP to calculate difference of two date in year, date should be assigned on ddmmyyyy



    from datetime import date

    firstdate = int("12052016") #ddmmyyyy
    lastdate = int("13062019")

    f1 = firstdate%10000
    print(f1)
    f2 = lastdate%10000
    print(f2)
    year = f2-f1
    print(year)

    ردحذف
  44. 1.WAP to calculate the sum of all digits in date of birth?

    num = int(input("Enter your birth year: "))
    x = num //1000
    print(x)
    x1 = (num - x*1000)//100
    print(x1)
    x2 = (num - x*1000 - x1*100)//10
    print(x2)
    x3 = num - x*1000 - x1*100 - x2*10
    print(x3)
    x4 = x+x1+x2+x3
    print ("sum of all digits in your birth year",x4)

    ردحذف
  45. 3.WAP to Convert feet to inch and inch to feet?

    feet = int(input("Enter the length in feet:"))
    # convert feet to Inches
    Inch = 12 * feet;

    print("The length in Inches is", round(Inch, 2))
    Inches = int(input("Enter the value of length in Inches:"))
    # convert Inches to Feet
    Feet = Inches / 12;

    print("The length in Feet", round(Feet, 2))

    ردحذف
  46. 4.WAP to convert km to meter?


    km=int(input("Enter Kilo Meters:"))
    m=km*1000
    print(m)

    ردحذف
  47. decimal number
    number = int(input("Enter any decimal number: "))

    # print equivalent binary number
    print("Equivalent Binary Number: ", bin(number))



    decimal number
    number = int(input("Enter any decimal number: "))

    # print equivalent binary number
    print("Equivalent Binary Number: ", bin(number))





    ردحذف

  48. 1.WAP to calculate the sum of all digits in date of birth?

    num = int(input("Enter your birth year: "))
    x = num //1000
    print(x)
    x1 = (num - x*1000)//100
    print(x1)
    x2 = (num - x*1000 - x1*100)//10
    print(x2)
    x3 = num - x*1000 - x1*100 - x2*10
    print(x3)
    x4 = x+x1+x2+x3
    print ("sum of all digits in your birth year",x4)

    ************************************************************************************************************

    2.WAP to calculate difference of two date in year, date should be assigned on ddmmyyyy


    date1 = int(input("Enter First Date in ddmmyyyy"))
    date2 = int(input("Enter Last Date in ddmmyyyy"))
    y1=date1 % 10000
    y2=date2 % 10000

    diff = y2-y1
    print("Difference between two date in year is ",diff)



    or

    firstdate = int("02061998") #ddmmyyyy
    lastdate = int("03072021")

    f1 = firstdate%10000
    print(f1)
    f2 = lastdate%10000
    print(f2)

    year = f2-f1

    print(year)



    ****************************************************************************************************************
    3.WAP to Convert feet to inch and inch to feet?

    feet = int(input("Enter the length in feet:"))
    # convert feet to Inches
    Inch = 12 * feet;

    print("The length in Inches is", round(Inch, 2))
    Inches = int(input("Enter the value of length in Inches:"))
    # convert Inches to Feet
    Feet = Inches / 12;

    print("The length in Feet", round(Feet, 2))


    ***************************************************************************

    4.WAP to convert km to meter?


    km=int(input("Enter Kilo Meters:"))
    m=km*1000
    print(m)
    *****************************************************************************
    5.WAP to convert decimal to binary?


    decimal number
    number = int(input("Enter any decimal number: "))

    # print equivalent binary number
    print("Equivalent Binary Number: ", bin(number))


    ******************************************************************************

    WAP to calculate basic, ta, da, comm, pf, HRA, Leave, numberofleave will be entered by the users?



    print("SALARY PROGRAM")
    name= str(input("Enter name of employee:"))
    basic=float(input("Enter Basic Salary :"))
    da=float(basic*0.25)
    hra=float(basic*0.15)
    pf=float((basic+da)*0.12)
    ta=float(basic*0.075)
    netpay=float(basic+da+hra+ta)
    grosspay=float(netpay-pf)

    print("\n\n")
    print("S A L A R Y D E T A I L E D B R E A K U P ")
    print("==============================================")
    print(" NAME OF EMPLOYEE : ",name)
    print(" BASIC SALARY : ",basic)
    print(" DEARNESS ALLOW. : ",da)
    print(" HOUSE RENT ALLOW.: ",hra)
    print(" TRAVEL ALLOW. : ",ta)
    print("==============================================")
    print(" NET SALARY PAY : ",netpay)
    print(" PROVIDENT FUND : ",pf)
    print("==============================================")
    print(" GROSS PAYMENT : ",grosspay)
    print("==============================================")


    ************************************************************************************






    ردحذف
  49. 1.WAP to calculate the sum of all digits in date of birth?

    num = int(input("Enter your birth year: "))
    x = num //1000
    print(x)
    x1 = (num - x*1000)//100
    print(x1)
    x2 = (num - x*1000 - x1*100)//10
    print(x2)
    x3 = num - x*1000 - x1*100 - x2*10
    print(x3)
    x4 = x+x1+x2+x3
    print ("sum of all digits in your birth year",x4)

    ************************************************************************************************************

    2.WAP to calculate difference of two date in year, date should be assigned on ddmmyyyy


    date1 = int(input("Enter First Date in ddmmyyyy"))
    date2 = int(input("Enter Last Date in ddmmyyyy"))
    y1=date1 % 10000
    y2=date2 % 10000

    diff = y2-y1
    print("Difference between two date in year is ",diff)



    or

    firstdate = int("02061998") #ddmmyyyy
    lastdate = int("03072021")

    f1 = firstdate%10000
    print(f1)
    f2 = lastdate%10000
    print(f2)

    year = f2-f1

    print(year)



    ****************************************************************************************************************
    3.WAP to Convert feet to inch and inch to feet?

    feet = int(input("Enter the length in feet:"))
    # convert feet to Inches
    Inch = 12 * feet;

    print("The length in Inches is", round(Inch, 2))
    Inches = int(input("Enter the value of length in Inches:"))
    # convert Inches to Feet
    Feet = Inches / 12;

    print("The length in Feet", round(Feet, 2))


    ***************************************************************************

    4.WAP to convert km to meter?


    km=int(input("Enter Kilo Meters:"))
    m=km*1000
    print(m)
    *****************************************************************************
    5.WAP to convert decimal to binary?


    decimal number
    number = int(input("Enter any decimal number: "))

    # print equivalent binary number
    print("Equivalent Binary Number: ", bin(number))


    ******************************************************************************

    WAP to calculate basic, ta, da, comm, pf, HRA, Leave, numberofleave will be entered by the users?



    print("SALARY PROGRAM")
    name= str(input("Enter name of employee:"))
    basic=float(input("Enter Basic Salary :"))
    da=float(basic*0.25)
    hra=float(basic*0.15)
    pf=float((basic+da)*0.12)
    ta=float(basic*0.075)
    netpay=float(basic+da+hra+ta)
    grosspay=float(netpay-pf)

    print("\n\n")
    print("S A L A R Y D E T A I L E D B R E A K U P ")
    print("==============================================")
    print(" NAME OF EMPLOYEE : ",name)
    print(" BASIC SALARY : ",basic)
    print(" DEARNESS ALLOW. : ",da)
    print(" HOUSE RENT ALLOW.: ",hra)
    print(" TRAVEL ALLOW. : ",ta)
    print("==============================================")
    print(" NET SALARY PAY : ",netpay)
    print(" PROVIDENT FUND : ",pf)
    print("==============================================")
    print(" GROSS PAYMENT : ",grosspay)
    print("==============================================")


    ************************************************************************************






    ردحذف
  50. #shalu
    nch =int("enter the value of inch")
    feet= inch % 12
    print("the convertion inch to feet is",feet)

    ردحذف
  51. #shalu
    def getdifference(dt1,dt2):

    dt1=[12,5,2016]
    dt2=[13,6,2019]
    print("difference between two dates is",getdifference(dt1,dt2))

    ردحذف
  52. #shalu
    a=123
    print(a)
    num1=a%10
    a=int(a/10)
    num2=a%10
    num3=a//10
    res=num1*100+num2*10+num3*1
    print(res)


    #second method
    b=45678
    print(b)
    num1=b%10
    b=(b//10)
    num2=b%10
    b=(b//10)
    num3=b%10
    b=(b//10)
    num4=b%10
    b=(b//10)
    num5=b%10
    b=(b//10)
    res=num1*10000+num2*1000+num3*100+num4*10+num5*1
    print(res)

    ردحذف
  53. #shalu
    #sum
    num=27091995
    a=num%1000
    num=num//1000
    b=num%100
    num=num//100
    c=num%10
    sum=a+b+c
    print(a+b+c)

    ردحذف
  54. WAP to calculate the sum of all digits in date of birth?

    num = int(input("Enter your birth year: "))
    x = num //1000
    print(x)
    x1 = (num - x*1000)//100
    print(x1)
    x2 = (num - x*1000 - x1*100)//10
    print(x2)
    x3 = num - x*1000 - x1*100 - x2*10
    print(x3)
    x4 = x+x1+x2+x3
    print ("sum of all digits in your birth year",x4)

    ************************************************************************************************************

    ردحذف
    الردود
    1. wap to calculate the total salary of an employee where basic ,ta, da,comm,pf,hra,leave,advance salary will be entered by the users?

      basic=5000
      ta=basic*(2/100)
      da=basic*(5/100)
      comm=basic*(5/100)
      emppf=basic*(8.33/100)
      employerpf=basic*(3.67/100)
      hra=basic*(10/100)
      advancesal=500
      nl=3
      tsal=basic+ta+da+comm
      leave=tsal/30
      ctc=basic+ta+da+comm+emppf+hra
      grossal=tsal-emppf-(nl-1)*leave-advancesal
      print("package is",12*ctc)
      print("gross salary is",grossal)
      print("leave deduction days,nl-1" and "amount is",(nl-1)*leave)
      print("pf diduction is",emppf)
      print("ta is",ta,"/n da is" ,da,"/n comm is",comm,"/n hra is",hra,"/n advance salary is",advancesal)

      حذف
  55. #Difference of two date in year?

    firstdate=int(input("enter first dob in ddmmyyyy"))
    seconddate=int(input("enter second dob in ddmmyyyy"))
    f1=firstdate%10000
    print(f1)
    f2=seconddate%10000
    print(f2)
    year=f2-f1
    print(year)

    ردحذف
  56. #sum of all digits in dob
    num = int(input("enter dob in from of ddmmyyyy"))
    r1=num%10000
    num1=num//10000
    print(r1 ,num1)
    r2=num1%100
    num2=num1//100
    print(r2,num2)
    r3=num2%10
    print(r3)
    sum = r1+r2+r3
    print(sum)

    ردحذف
  57. #convert inch to feet
    inch = float(input("enter a value "))
    feet = inch//12
    print(feet)

    ردحذف
  58. #convert feet to inch?
    feet=float(input("enter the value"))
    inch=feet*12
    print(inch)

    ردحذف
  59. #Decimal to binary?
    num=12
    s=""
    a=num%2#0
    s=s+str(a)
    num=num//2#6
    a=num%2#0
    s=s+str(a)
    num=num//2#3
    a=num%2#1
    s=s+str(a)
    num=num//2#1
    a=num%2#1
    s=s+str(a)
    print(s)

    ردحذف
  60. #reverse a nos
    num=123
    a=num%10
    b=num//10
    c=b//10
    d=b%10
    print(a*100+d*10+c*1)

    ردحذف
  61. dn=int(input("Enter any no"))
    rem=0
    bn=0
    place=1
    while(dn!=0):
    rem=dn%2
    bn=bn+(rem*place)
    place=place*10
    dn=dn//2

    print(bn)

    ردحذف

  62. up=float(input("enter price")) #unit price
    cons=float(input("enter consumption")) #consumption
    load=float(input("enter extra load unit"))

    bill=up*cons
    print("Total bill without load=",bill)
    bill2=2*up*load
    print("extra load bill=",bill2)
    bill3=up*cons+2*(up*load)
    print("Total bill with extra load=",bill)

    ردحذف
  63. أزال المؤلف هذا التعليق.

    ردحذف
  64. firstdate = int(input("enter firstdate"))
    lastdate = int(input("enter lastdate"))
    a1= firstdate%10000
    a2 = lastdate%10000
    year=a2-a1
    print(year)

    ردحذف
  65. أزال المؤلف هذا التعليق.

    ردحذف
  66. أزال المؤلف هذا التعليق.

    ردحذف
  67. #WAP to calculate the sum of all digits in date of birth?
    dob=12012001
    a=dob%10 #1
    dob=dob//10 #1201200
    b=dob%10 #0
    dob=dob//10 #120120
    c=dob%10 #0
    dob=dob//10 #12012
    d=dob%10 #2
    dob=dob//10 #1201
    e=dob%10 #1
    dob=dob//10 #120
    f=dob%10 #0
    dob=dob//10 #12
    g=dob%10 #2
    dob=dob//10 #1
    h=dob%10
    dob=dob//10
    print(a+b+c+d+e+f+g+h)

    ردحذف
إرسال تعليق