Example HTML page

Python Exercise 8

The following questions are only based on arithmetic and comparison operators.

1. What is the output of the following expressions?
a. 10/2
b. 10//2
c. 10.0//2

2. What is the output of the following expression?
2*”sudhakar”+2*”welcome”.

3. Write a python expression to print the following results using repetition operator.
Assume str1=”Python”, str2=”is”, str3=”good”
a. Python is good
b. PythonPython isis good
c. Pythonis Pythonis good good
d. PythonPythonPythonisisisgood
e. Pythonisverygoodlanguage

4. Write a python expression to read two strings from the user and find the length of the concatenated string?

5. Write a python expression to read two strings from the user and find the difference between the length of the two strings? For example if string 1 is “sudha”, string 2 is “sudhakar”, the output is 3.

6. Write a python script to print the addition,subtraction,multiplication,modulus value between the length of the two strings? Note: Take two strings from the user.

7. Write a python expression to take three floating point numbers from the user and print the result in integer form?
a.addition
b.subtraction
c.division (either from left to right or right to left)
d.modulus (either from left to right or right to left)

8. Write a python expression to compute the result of 2 power of 2 power of 2.
Note: In mathematics 2 to the power of 2 to the power of 2 is 16.
a. using operator.
b. using power function.

9. Write a python expression two read two characters from the user.
a. print the ASCII values of the corresponding characters.
b. print the difference between the two ASCII values.

10. Write a python expression to read two numbers from the user.
a. print the alphabetic character for the corresponding ASCII values.
b. using comparison operator check the equality of these two values.
c. using identity operator check the identity of these two values.

Example HTML page

One thought on “Python Exercise 8

  • November 23, 2018 at 3:41 am
    Permalink

    I think the admin of this web page is truly working hard in favor of his web site, as here every information is quality based stuff.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

Pin It on Pinterest