PYCHARM QUIZ DESCRIPTION

Which of the following is used to define a block of Python code in PyCharm?

  • Indentation
     

  • Key
     

  • Brackets
     

  • All of the mentioned

What will be the output of the following PyCharm function?
min(max(False,-3,-4), 2,7)

  • -4

  • -3

  • 2

  • false

In PyCharm, which of the following is a Python tuple?

  •  {1, 2, 3}
     

  •  {}
     

  •  [1, 2, 3]
     

  •  (1, 2, 3)

What will be the output of the following Python program in PyCharm?

def foo(x):
    x[0] = ['def']
    x[1] = ['abc']
    return id(x)
q

  • Error

  • None

  • False

  • True

In PyCharm,which one of the following is not a keyword in Python language?

  • pass
     

  • eval
     

  •  assert
     

  •  nonlocal

 

What will be the output of the following Python code in PyCharm?

list1 = [1, 3]
list2 = list1
list1[0] = 4
print(list2)

  • [1, 4]
     

  •  [1, 3, 4]
     

  •  [4, 3]
     

  •  [1, 3]

What will be the output of the following Python code in Pycharm?

class tester:
   def __init__(self, id):
       self.id = str(id)
       id="2

  • 12

  • 224

  • None

  • Error

In PyCharm will the expression shown below results in an error.
print("-%5d0",989)

  • True

  • false

All python keywords in PyCharm are in _________

  • Capitalized
     

  • lower case
     

  • UPPER CASE
     

  • None of the mentioned

What will be the output of the following PyCharm code snippet?
for i in [1, 2, 3, 4][::-1]:
print (i)

  • 4 3 2 1
     

  •  error
     

  •  1 2 3 4
     

  •  none of the mentioned

In PyCharm, what will be the output of the following Python code?
random.randrange(1,100,10)

  •  32
     

  •  67
     

  •  91
     

  • 80

Which of the following is not a core data type in Python programming in PyCharm?

  • Tuples
     

  •  Lists
     

  • Class
     

  • Dictionary

In PyCharm, which of the following functions can help us to find the version of python that we are currently working on?

  •  sys.version(1)
     

  • sys.version(0)
     

  •  sys.version()
     

  •  sys.version

Which of the following is the truncation division operator in PyCharm?

  • |
     

  • //

  • /

  • %

What will be the output of the following Python code in PyCharm?
random.randrange(0,91,5)

  • 10
     

  •  18
     

  •  79
     

  •  95

Which of these is the definition for packages in PyCharm?

  • A set of main modules
     

  • A folder of python modules
     

  •  A number of files containing Python definitions and statements
     

  •  A set of programs making use of Python modules

What will be the output of the following Python expression if x=56.236 in PyCharm?
print("%.2f"%x)

  • 56.00
     

  •  56.24
     

  •  56.23
     

  •  0056.236

Which of the following functions helps us to randomize the items of a list in PyCharm?

  • seed
     

  • randomise
     

  •  shuffle
     

  • uniform

What will be the value of the following Python expression in PyCharm?
4 + 3 % 5

  • 7

  • 2

  • 4

  • 1

In PyCharm, what will be the output of the following Python code?
import random
random.choice(2,3,4)

  • An integer other than 2, 3 and 4
     

  •  Either 2, 3 or 4
     

  • Error
     

  •  3 only

What will be the output of the following Python code in PyCharm?
random.seed(3)
random.randint(1,5)
2
random.seed(3)
random.randint(1,5)

  • 3
     

  • 2
     

  •  Any integer between 1 and 5, including 1 and 5
     

  •  Any integer between 1 and 5, excluding 1 and 5

In PyCharm, which one of the following is the use of function in python?

  • Functions don’t provide better modularity for your application
     

  • you can’t also create your own functions
     

  •  Functions are reusable pieces of programs
     

  •  All of the mentioned

Which of the following character is used to give single-line comments in PyCharm?

  • //
     

  •  #
     

  • !
     

  •  /*

What will be the output of the following Python code in PyCharm?
print("abc. DEF".capitalize())

  •  Abc. def
     

  • abc. def
     

  • Abc. Def
     

  • ABC. DEF

What will be the output of the following Python code in PyCharm?
import random
random.choice([10.4, 56.99, 76])

  • Error
     

  •  Either 10.4, 56.99 or 76
     

  •  Any number other than 10.4, 56.99 and 76
     

  •  56.99 only

In PyCharm, what will be the output of the following Python expression if x=22.19?
print("%5.2f"%x)

  •  22.1900
     

  •  22.00000
     

  •  22.19
     

  • 22.20

In PyCharm, what will be the output of the following Python code?
print('*', "abcde".center(6), '*', sep='')

  •  * abcde *
     

  •  *abcde *
     

  •  * abcde*
     

  •  * abcde *

Which of the following is the use of id() function in PyCharm?

  • Every object in Python doesn’t have a unique id
     

  •  In Python Id function returns the identity of the object
     

  •  None of the mentioned
     

  •  All of the mentioned

 

What will be the output of the following Python code snippet in PyCharm?

X=”hi”
print(“05d”%X)

  • 00000hi
     

  •  000hi
     

  •  hi000
     

  •  error

What will be the output of the following Python code snippet in PyCharm?
X=”watch-ing”
print(“%56s”,X)

  • 56 blank spaces before watch-ing
     

  •  56 blank spaces before watch and ing
     

  •  56 blank spaces after watch-ing
     

  •  no change