DMT Report

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

Name= Muhammad Salman

BBA, Semester=5, Group= B


Subject= DMT
Assighment= 1

1. Write a program to print the sum of the current number and the previous
number.

2. Write a program to print characters from a string that are present at an


even
index number.
For example, str = “python”, then the output should be ‘p, t, o’.
3. Write a program to remove characters from a string starting from zero up
to n and return a new string.

4. Write a program to swap the two elements in a list.

5. Write a program to find the cube of a number.


6. Write a program to calculate the profit and loss using the if elif statement.

7. Write a program to find the square of a number.


8. Write a program to find the square root of a number.

9. Write a program to find student grades by calculating the total, and


percentage of five subjects.

10.Write a Python program to find the sum and average of three numbers.
11. Write a program to convert kilometers to miles.

12. Write a program to convert Celsius to Fahrenheit.

13. Write a program to find the area of a triangle.

14. Write a program to find the length of a user-defined string.


15. Write a program to print the alternate element of a string in a reverse
order.

You might also like