Showing posts with label Python Fundamental Test. Show all posts
Showing posts with label Python Fundamental Test. Show all posts

Class XI : Chapter 1 - Python Fundamental Test 12

 

Python Fundamental Test 12

Q1. Write a program to find the average of five numbers.

Q2. Write a program to find the square of a number accepted from user.

Q3. Write a program to convert kilometer into centimeter.

Q4. Write a program to convert degree Celsius to kelvin.

Q5. Write a program to convert degree Celsius to Fahrenheit.

Q6. Write a program to calculate the simple interest.

Q7. Write a program to accept time in seconds and convert it into

    hours, minutes and seconds.

Q8. Write a program to convert milligrams into kilograms.

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

Q10. Write a program to accept two numbers and display their

  •  Sum
  • Difference
  • Product
  • Multiplication

Class XI : Chapter 1 Python Fundamental Test -11

 

Class XI: Python Fundamental Test 11


Q1. Is python a case sensitive language?

Q2. 63 is maximum possible length of identifier (T/F)

Q3. Print function is used to accept data from the user (T/F)

Q4. Python programs typed in __________ mode.

Q5. Which keyword in python is in upper case?

Q6. Variable names can be of __________ length.

Q7. Write the output of the following:

>>> a, b c = 10, 20, 30

>>> a = b + c

>>> print (a, b, c)

Q8. Identify the invalid variable name and specify the reason.

  •  Place
  • Cut_1
  • 12A
  • A#b
  • A1 b

Q9. Write the output of the following.

>>>print (“Introduction to Python\n Class\t XI”)

Q10. Write the output of the following:

>>>print(5*1**9)

Class XI : Chapter 1 Python Fundamental Test -10

 Q1. Write a program to accept radius of circle and display it's area and circumference.

Q2. Write a program to find the average marks of five subjects. (Accept marks from user)

Q3. Write a program to find the area of right angle triangle. (Accept base and height from user)

Q4. Write a program to print the following pattern without loop.

*

* *

* * *

* * * *

Q5. Write a program to find the volume of sphere.(Accept radius from the user)

Q6. Find errors

  1. a = input(Enter your name)
  2. b = input("Enter any number")
Q7. Find errors:
            a = input("Enter your name"
            Print(Your name is, a)
Q8. Write the output of the following

        a, b = 2, 6

                a, b, b = a+b, 2, 3

                print(a,b)

Q9. Write the output of the following.
        a = 5
        b = "Amit"
        print(a + b)

Q10. Write the output of the following.
        a =3
        b =4
        print(a + b%2 + a**2)

Class XI : Chapter 1 Python Fundamental Test - 9

 Q1. What do you mean by comment in python?

Q2. A comment in python starts with __________ symbol.

Q3. Is python a case sensitive?

Q4. What do you mean by dynamic typing?

Q5. Define the following term

  1. Token
  2. Keyword
  3. String
  4. Operators
  5. int() function
  6. type() function
  7. eval() function
  8. input() function.
Q6. Precision of _________ digits in floating point numbers in python.

Q7. input() function always return a value of __________ type.

Q8. Write the output of the following
        >>> x , y = 3, 5
        >>>x, y = y, x + 6
        >>> print(x,y)

Q9. What is the extension of python file?

Q10.  Find the error in the following code

            def sub(n1, n2)
            res = n1 - n2
            return res


Class XI : Chapter 1 Python Fundamental Test - 8

 Q1. What is the difference between eval() and int() function?

Q2. What do you mean by function?

Q3.Write the output of the following

    >>>eval('15')

    >>>eval("6")

    >>>eval(7)

    >>>eval("5 + 8 * 6)

Q4. def command is used to define a function or to call a function.

Q5. Write a user defined function to find the area of rectangle.

Q6. Wrie a user defined function to print "Hello" five times.

Q7. Write a user defined function to find the area of cube.

Q8. All statements in python are terminated by semicolon.(T/F)

Q9. How many spaces are there in one indentation level?

Q10. In python one line can be of maximum ___________ characters.

Class XI : Chapter 1 Python Fundamental Test - 5

 Q1. Write the output of the following :

>>> x = 8

>>> x = 5

>>> print (x + x)

Q2. Is the following statement correct?

>>> a, b, c = 2 , 3 , 'Amit'

Q3. Identify the invalid variable names from the following and specify the reason also.

  1. m_n
  2. unit_day
  3. 24Apple
  4. #sum
  5. for
  6. s name

Q4. What are keywords?

Q5. Keywords can be used as variable names (T/F)

Q6. Write the code to display all the keywords available in python.

Q7. What do you mean by expression?

Q8. Write the python expressions equivalent to the following algebraic/arithmetic expressions

  1. z = u/5
  2. z = 9ab + d
  3. z = x+4/j + 7
 
Q9. What are operators? Name three types of operators.

Q10. >>> 7 % 10 will return ____________________


SOLUTIONS

 Q1. Write the output of the following :

>>> x = 8

>>> x = 5

>>> print (x + x)

Ans. 10

Q2. Is the following statement correct?

>>> a, b, c = 2 , 3 , 'Amit'

Ans. yes

Q3. Identify the invalid variable names from the following and specify the reason also.

  1. m_n
  2. unit_day
  3. 24Apple
  4. #sum
  5. for
  6. s name
Ans. 24apple : Variable can not start with number
        #sum : Variables can not start from special character.
        for : Keyword can not be used as variable
        s name : Spaces are not allowed in variable names

Q4. What are keywords?

Ans. Keywords are reserved words which have special meanings to python

Q5. Keywords can be used as variable names (T/F)

Ans. False

Q6. Write the code to display all the keywords available in python.

Ans. 

import keyword

print(keyword.kwlist)

Q7. What do you mean by expression?

Ans. A combination of operators and operands is called expression. 

        like - a + b * c

Q8. Write the python expressions equivalent to the following algebraic/arithmetic expressions

  1. z = u/5
  2. z = 9ab + d
  3. z = x+4/j + 7
Ans. 
1. z = u/5
2. z = 9*a*b + d
3. z = x + 4/j + 7
 
Q9. What are operators? Name three types of operators.
Ans. Operators are special symbols that perform a specific task (arithmetic 
        or logical operations)
Three types of operators are
1. Logical Operators
2. Relational Operator
3. Mathematical Operator

Q10. >>> 7 % 10 will return ____________________

Ans 7




Computer Science Class XI - Chapter 1 Python Fundamental Test 4

Computer Science Class XI - Chapter 1 Python Fundamental Test 4 

Q 1. What do you mean by Escape sequence?

Q 2. Write the output of the following

        a    >>> x = 2 + 5j

               >>> print(x.real, x.imag)

Q 3. What is None data type?

        

Q 4. Write the output of the following

        >>> v1 = 10

        >>> v2 = None

        >>> v1

        >>> v2

        >>>print(v2)

Q 5. What is the purpose of type() function?

Q 6. Write the output of the following.

        >>> type(10)

        >>>type('10')

        >>>type(10.0)

        >>>type(True)

        >>>type('False')

Q 7. Which function is used to find the data type of variable?

Q 8. Write the output of the following

        >>> a = "hello"

        >>> b = 10

        >>> c = 9.8

        >>> d = 7 + 3.6j

        >>> print(a)

        >>> print(b)

        >>> print(c)

        >>> print(d)

Q9. Identify the variable name, variable type, value and operator used in the following statement.

        >>> x = 9

Q 10. What do you mean by assignment operator?


 SOLUTIONS

Q 1. What do you mean by Escape sequence?

Ans The sequence of characters after backslash is called escape 

       sequence.

Q 2. Write the output of the following

        a    >>> x = 2 + 5j

               >>> print(x.real, x.imag)

Ans. 2.0 5.0

Q 3. What is None data type?

Ans. This data type is used to define null value or no value. 

        for example

        m = none, Now the variable 'm' is not pointing to any value, instead it 

        is pointing to none

Q 4. Write the output of the following

        >>> v1 = 10

        >>> v2 = None

        >>> v1

        >>> v2

        >>>print(v2)

Ans. 

10

None

Q 5. What is the purpose of type() function?

Ans. This function tell us about the data type of a variable. for example

a = 10

print(type(a))

OUTPUT : <class 'int'>

Q 6. Write the output of the following.

        >>> type(10)

        >>>type('10')

        >>>type(10.0)

        >>>type(True)

        >>>type('False')

Ans. <class 'int'>

        <class 'str'>

        <class 'float'>

        <class 'bool'>

        <class 'str'>

Q 7. Which function is used to find the data type of variable?

Ans. type() function

Q 8. Write the output of the following

        >>> a = "hello"

        >>> b = 10

        >>> c = 9.8

        >>> d = 7 + 3.6j

        >>> print(a)

        >>> print(b)

        >>> print(c)

        >>> print(d)

Ans

hello

10

9.8

7 + 3.6j

Q9. Identify the variable name, variable type, value and operator used in the following statement.

        >>> x = 9

Ans.

variable name -- x

variable type -- integer

value -- 9

operator -- =

Q 10. What do you mean by assignment operator?

Ans. An operator which is used to assign a value to a variable is called assignment operator. Symbol of assignment operator is '=', for example 

c = 10, value 10 will be assigned to variable 'c'

Most Recently Published

File Handling Test 6

 File Handling Test 6 Q1 . Do we need to use the close() function when we use 'with' statement to open a file? Q2. Which mode you wi...

CS - IP Assignment/Worksheet