Course Hero Logo

CH2.docx - 4CH-2 Python Fundamentals #Q3. Write a program...

Course Hero uses AI to attempt to automatically extract content from documents to surface to you and others so you can study better, e.g., in search results, to enrich docs, and more. This preview shows page 1 - 3 out of 4 pages.

4CH-2 Python Fundamentals#Q3. Write a program that generates the following output:#5#10#9x=5print(x)x=x*2print(x)x=x-1print(x)#Q4. Modify above program to print [email protected]@9x=5print(x,end="")print("@",end="")x=x*2print(x,end="")print("@",end="")x=x-1print(x)#Q8. Write a program that accepts height in cm and convert it to feet andinches
inch = int(cm/2.54)foot = inch//12rem_inch = inch%12print("Your height is",foot,"foot and",rem_inch,"inch")#Q9. Write a python program to read a number and display# n^2, n^3,n^4n = int(input("Enter the number n: "))print(n**2)print(n**3)print(n**4)#Q10. Write a program to take input of base and height of triangle andcalculate its areab = float(input("Enter the base :"))h = float(input("Enter the height :"))area = 0.5*b*hprint("Area of triangle is",area)#11. Write a program to calculate SI andCIp = float(input("Enter the principal :"))r = float(input("Enter the rate of interest :"))t = float(input("Enter the time :"))SI = p*r*t/100CI = p*((1+r/100)**t-1)print("Your SI is ",SI)print("Your CI is ",CI)

Upload your study docs or become a

Course Hero member to access this document

Upload your study docs or become a

Course Hero member to access this document

End of preview. Want to read all 4 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Fall
Professor
N/A
Tags
1inch, 1foot, Q10, Q12

Newly uploaded documents

Show More

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture