Python

Python

Core Datatypes has 13 Questions
Select all options that print hello-how-are-you

print('hello', 'how', 'are', 'you')
print('hello', 'how', 'are', 'you' + '-' * 4)
print('hello-' + 'how-are-yo
print('hello' + '-' + 'how' + '-' + 'are' + '-' + 'you')
What is the return value of trunc()?

int
bool
float
None
Which of these in not a core datatypes

Lists
Dictionary
Tuples
Class
Given a function that does not return any value, What value is thrown by itby default when executed in shell

int
bool
void
None
Following set of commands are executed in shell, what will be the output?
  1. >>>str="hello"
  2. >>>str[:2]
  3. >>>str

he
lo
olleh
hello
Which of the following will run without errors(multiple answers possible)?

round(45.8)
round(6352.89
round()
round(7463.123,2,1)
What is the return type of function id?

int
float
bool
dict
What error occurs when you execute? apple = mango

SyntaxError
NameError
ValueError
TypeError
Carefully observe the code and give the answer.
  1. def example(a):
  2.     a = a + '2'
  3.      a = a*2
  4.     return a
  5. >>>example("hello")

indentation Error
cannot perform mathematical operation on strings
hello2
hello2hello2
What dataype is the object below ? L = [1, 23, 'hello',1]

List
dictionary
array
tuple
In order to store values in terms of key and value we use what core datatype

List
tuple
class
dictionary
Which of the following results in a SyntaxError(Multiple answers possible)?

'"?Once upon a time..."?, she said.'
"He said, "Yes!"?"?
'3f
"?'That's okay"?'
What is the average value of the code that is executed below ?
  1. >>>grade1 = 80
  2. >>>grade2 = 90
  3. >>>average = (grade1 + grade2) / 2

85
85.0
95
95.0