Ask Other Engineering Expert

QUESTION 1. Which of these is not a core datatype?

Lists

Dictionary

Tuples

Class

QUESTION 2. Given a function that does not return any value, What value is returned by default when executed in shell.

int

bool

void

None

QUESTION 3. Given the commands below, what will be the output?
str="hello"
str[:2]
str
he
lo

olleh

hello

QUESTION 4. Choose the answers below that will run without errors.

round(45.8)

round(6352.898,2)

round()

round(7463.123,2,1)

QUESTION 5. What does the function 'id' return?

int

float

bool

dict

QUESTION 6. Choose the modified the statement(s) below that will serve to make sure x has a integer value.
x = 13 ? 2

x = 13 // 2

x = int(13 / 2)

x = 13 / 2

x = 13 % 2

QUESTION 7. Based on the following statement, which error will be thrown?
apple = mango

SyntaxError

NameError

ValueError

TypeError

QUESTION 8. Based on the code, and example input, choose the expected output.
def example(a):

a = a + '2'
a = a*2
return a
example("hello")

indentation Error

cannot perform mathematical operation on strings

hello2

hello2hello2

QUESTION 9. Identify the datatype assigned to L.
L = [1, 23, 'hello', 1]

List

dictionary

array

tuple

QUESTION 10. 10. Which structure describes key vale pairs?

List

tuple

class

dictionary

QUESTION 11. Choose the statements that will result in SyntaxError.

‘"Once upon a time...", she said.'

"He said, "Yes!""

'3\'

"'That's okay"'

QUESTION 12. Choose the code that produced the following output.
tom
dick
harry
Select all of the function calls that result in this output

print("'tom
\ndick
\nharry"')

print("'tom
dick
harry"')

print(‘tom\ndick\nharry')

print(‘tom
dick
harry')

QUESTION 13. 13. Choose the output of the code below.
grade1 = 80
grade2 = 90
average = (grade1 + grade2) / 2

85

85.0

95

95.0

QUESTION 14. Choose the statement(s) that will produce the following output.
hello-how-are-you

print(‘hello', ‘how', ‘are', ‘you')

print(‘hello', ‘how', ‘are', ‘you' + ‘-' * 4)

print(‘hello-' + ‘how-are-you')

print(‘hello' + ‘-' + ‘how' + ‘-' + ‘are' + ‘-' + ‘you')

QUESTION 15. What is the return value of trunc() ?

int

bool

float

None

QUESTION 16. Choose the output for the following statement.
"a"+"bc"

a

bc

bca

abc

QUESTION 17. Choose the output for the following statement.
"abcd"[2:]

a

ab

cd

dc

QUESTION 18. Choose an alternate way to execute string.ascii_letters.

string.ascii_lowercase_string.digits

string.ascii_lowercase+string.ascii_upercase

string.letters

string.lowercase_string.upercase

QUESTION 19. Choose the output for the following code.
str1 = 'hello'
str2 = ','
str3 = 'world'
str1[-1:]

olleh

hello

h

o

QUESTION 20. Which of the following operators cannot be used with strings ?

+

*

-

**

QUESTION 21. Choose the output for the following statement.
print r"\nhello"

a new line and hello

\nhello

the letter r and then hello

Error

QUESTION 22. Choose the output for the following statement.
print 'new' 'line'

Error

Output equivalent to print ‘new\nline'

newline

new line

QUESTION 23. Choose the output for the following statement.
print '\x97\x98'

Error

97

98

\x97\x98

QUESTION 24. Choose the output for the following statement.
str1="helloworld"
str1[::-1]

dlrowolleh

hello

world

helloworld

QUESTION 25. Choose the output for the following statement.
print 0xA + 0xB + 0xC :

0xA0xB0xC

Error

0×22

33

Other Engineering, Engineering

  • Category:- Other Engineering
  • Reference No.:- M91802296
  • Price:- $40

Priced at Now at $40, Verified Solution

Have any Question?


Related Questions in Other Engineering

Register design a cpu register is simply a row of

Register design A CPU register is simply a row of flip-flops (i.e. SR, JK, T, etc) put side by side in an array to make the size of register required. For example, an 8 bit register has 8 flip-flops side by side for stor ...

A detailed review of spatial modulation and simulation

A Detailed Review of Spatial Modulation and Simulation Learning Outcomes a. Learn how to model mobile communication channels d. Discern knowledge development and directions on the recent advances in 4G to the research pr ...

Mine safety amp environmental engineering assignment -part

Mine Safety & Environmental Engineering Assignment - Part 1 - Questions 1. Occupational health and safety is the primary factor that needs to be considered in the mining industry. Discuss this statement. 2. Define the fo ...

Projectflow processing of liquor in a mineral refining

Project Flow Processing of Liquor in a Mineral Refining Plant The aim of this project is to design a flow processing system of liquor (slurry) in a mineral (aluminum) refining plant. Aluminum is manufactured in two phase ...

Learning outcomes evaluate multiuser communication and

Learning Outcomes Evaluate multiuser communication and resource sharing techniques; Apply the techniques of, and report on, digital communication applications using Matlab and hardware devices. Assignment Description The ...

Operations engineering assignment -please select only one

Operations Engineering Assignment - Please select only one of the following case studies for your assignment: CASE A. Tesla Motors Tesla is an innovative manufacturer that designs, assemble and sells fully electric vehic ...

Select a risk problem from the list below and prepare a

Select a risk problem from the list below and prepare a risk management plan in accordance with AS/NZS ISO 31000:2009. Please ensure that: - Establish the context clearly, in accordance with the Standard; - Define your s ...

Engineering materials term paper assignment -conduct a

ENGINEERING MATERIALS TERM PAPER ASSIGNMENT - Conduct a thorough literature search and write a 15-20 page technical review paper on the evolution of the engineering materials used in the manufacturing of any one of the f ...

Task 1using the lab kit design a circuit for the processor

Task 1: Using the lab kit, design a circuit for the processor to control the output of a connected 7-segment LED display device. You will be provided with a standard common anode 7-segment display of the type FND-507 (or ...

Control theory - lab reportsfor experiments 1 to 4 you must

Control Theory - Lab Reports For experiments 1 to 4 you must undertake the following: a) At the start of each section (including the pre-lab activities) there are a number learning outcomes. That is, what students should ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As