0% found this document useful (0 votes)
8 views

Python File

EXTERNAL PYTHON FILE

Uploaded by

imemyselfff01
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Python File

EXTERNAL PYTHON FILE

Uploaded by

imemyselfff01
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

INDEX

S.no Question Pg No. Sign


1 Write a program to enter two integers, two floating numbers 1
and then perform all arithmetic operations on them.
2 In this scenario, two friends are eating dinner at a restaurant. 2
The bill comes in the amount of 547.28. The friends decide to
split the bill evenly between them, after adding 15% tip for the
service. Calculate the tip, the total amount to pay, and each
friend's share, then output a message saying "Each person
needs to pay: " followed by the resulting number.
3 This code is supposed to take two numbers, divide one by 3
another so that the result is equal to 1, and display the result
on the screen. Write the code.
4 Write a program that receives a name, then returns a greeting 3
based on whether or not that name is "Taylor".
5 Write a program to check the no is odd or even. 4
6 Write a program using bitwise operator. 4
7 Write a program to find the largest no out of 2 numbers. 5
8 Write a program to find the largest no out of 3 numbers. 6
9 Find the sum of odd no. and even no from a range between 1 to 6
101.
10 Write a program to take 5 subjects marks, and compute total, 7
average and grade based on the marks.
11 Write a program to input any choice and to implement the 8-9
following.
Choice Find
1. Area of square
2. Area of rectangle
3. Area of triangle
12 Write a program using logical operator. 9
13 Write a program to check whether a number is an Armstrong 10
number or not.
14 Write a program to print the sum of all the primes between 10
two ranges.
15 Write a program to swap two strings. 11
16 Write a program to find whether the year is a leap year or not. 12
17 Write a menu driven program to accept two strings from the 13
user and perform the various functions using user-defined
functions.
18 Write a program to find the smallest and largest number in a list. 14

19 Write a program that uses a user defined function that accepts 15


name and gender (as M for Male, F for Female) and prefixes
Mr./Ms. on the basis of the gender.

20 Write a program to print the Fibonacci series using 16


recursion.
1. Write a program to enter two integers, two floating numbers and then
perform all arithmetic operations on them.

Input

Output

Priyanshu Sharma BCA 2nd Shift


2. In this scenario, two friends are eating dinner at a restaurant. The bill
comes in the amount of 547.28. The friends decide to split the bill evenly
between them, after adding 15% tip for the service. Calculate the tip, the
total amount to pay, and each friend's share, then output a message saying
"Each person needs to pay: " followed by the resulting number.

Input

Output

Priyanshu Sharma BCA 2nd Shift


3. This code is supposed to take two numbers, divide one by another so that
the result is equal to 1, and display the result on the screen. Write the
code.
Input

Output

4. Write a program that receives a name, then returns a greeting based on


whether or not that name is "Taylor".
Input

Output

Priyanshu Sharma BCA 2nd Shift


5. Write a program to check the no is odd or even.
Input

Output

6. Write a program using bitwise operator.


Input

Output

Priyanshu Sharma BCA 2nd Shift


7. Write a program to find the largest no out of 2 numbers.

Input

Output

Priyanshu Sharma BCA 2nd Shift


8. Write a program to find the largest no out of 3 numbers.
Input

Output

Priyanshu Sharma BCA 2nd Shift


9. Find the sum of odd no. and even no. from a range between 1 to 101.
Input

Output

Priyanshu Sharma BCA 2nd Shift


10. Write a program to take 5 subjects marks, and compute total, average and
grade based on the marks.

Input

Output

Priyanshu Sharma BCA 2nd Shift


11. Write a program to input any choice and to implement the following.
Choice Find
1. Area of square
2. Area of rectangle
3. Area of triangle

Input

Priyanshu Sharma BCA 2nd Shift


Output

12. Write a program using logical operator.


Input

Output

Priyanshu Sharma BCA 2nd Shift


13. Write a program to check whether a number is an Armstrong number or
not.
Input

Output

14. Write a program to print the sum of all the primes between two ranges.
Input

Output

Priyanshu Sharma BCA 2nd Shift


15. Write a program to swap two strings.

Input

Output

Priyanshu Sharma BCA 2nd Shift


16. Write a program to find out whether the year is a leap year or not.

Input

Output

Priyanshu Sharma BCA 2nd Shift


17. Write a menu-driven program to accept two strings from the user and
perform the various functions using user-defined functions.

Input

Priyanshu Sharma BCA 2nd Shift


Output

Priyanshu Sharma BCA 2nd Shift


18. Write a program to find the smallest and largest number in a list.

Input

Output

Priyanshu Sharma BCA 2nd Shift


19. Write a program that uses a user-defined function that accepts name and
gender (as M for Male, F for Female) and prefixes Mr./Ms. based on the
gender.

Input

Output

Priyanshu Sharma BCA 2nd Shift


Priyanshu Sharma BCA 2nd Shift
20. Write a program to print the Fibonacci series using recursion.
Input

Output

Priyanshu Sharma BCA 2nd Shift

You might also like