DS140223 -python quiz by TA

Date : 22/2/23
1.what does immutable mean and what three types of python code data types are considered immutable?

2.Scientific notation for float number 0.0001234 is
a.1234e-10
b.1.234e-04
c.0.1234E-6
d.None of the above

3.What is about complex numbers?
a.the real and imaginary component can be float
b.the real part should be an integer
c.scientific notation cannot be used in complex number
d.all the above

4.The int() function can be useful to convert
a.string to integer
b.hexadecimal to integer
c.float to int
d.complex number to int

5.which of the following is true
a.9%2=4
b.9//2=4
c.9/2=4
d.none of the above

2 Likes

1.value cannot be changed. int ,float and str are immutable
2.b
3.d
4.a &c
5.b

1 Like
  1. immutabe in Python means the memory location assigned which cannot be reused. ex. String, Numeric, Tuple
    2.b
    3.a
    4.c
    5.b
1 Like

1.Immutable means that the object cannot be changed after it has been created. data types that are considered immutable, includes integers, floats, and tuples.
2.A
3.A
4.B
5.A

1 Like

1 list dictionary set
2.1.234e-04
3.the real part should be an integer
4.string to integer
5.9/2=4

1)Immutable means the value of any particulars data cannot be changed.three tyes: int,str,tuple
2)b
3)d
4)c
5)b

1 Like
  1. The data types whose value or memory location cannot be changed are called immutable data
    types. Tuple, integer, float, bool etc are some immutable data types.

  2. b

  3. a

5.b

1 Like
  1. immutable is the value that can not be changed
    eq: number,string,tuple
  2. d
    3.a
    4.a
    5.b
1 Like
  1. Immutable objects cannot be changed once they are created.
    Three types are Numbers, Tuples and Strings.

  2. b

  3. a

  4. a b c

  5. b

1 Like
  1. Immutable in python means the value assigned to a variable cannot be changed. three types of immutable data types are Numbers, tuples, and strings.
    2 .1.234e-04
  2. a
  3. a,b,c
  4. b
1 Like