Returned by default when executed in shell

Assignment Help Other Engineering
Reference no: EM131075452

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

Reference no: EM131075452

Questions Cloud

Cultural and environmental aspects that mcdonald : Discuss the product and consumer related factors that McDonald's should take into account in order to compete successfully in the European fast food sector. Explain the cultural and environmental aspects that McDonald's need to consider and reevalu..
Virgin galactic brand and creating a clear positioning : What do you think about that price of $250K? Is this pricing strategy likely to be effective in building the Virgin Galactic brand and creating a clear positioning for the brand in the marketplace? To learn more about what that price 'buys' you, g..
Encrypt words routine and file manipulation in python : Encrypt the following words using a Caesar cipher with a distance value of 5. Provide an algorithm written in python to generate the cypher.
What is the gdp per capita in each given country : What is the GDP per capita in each country? Which country has more abundant natural resources? Explain. Which country relies more heavily on the market system? Explain.
Returned by default when executed in shell : QUESTION 2. Given a function that does not return any value, What value is returned by default when executed in shell.
Review the concepts of acute-chronic and distant stress : Consider the chronic stress of being a family caregiver to an Alzheimer's patient. Betty has been caring for Fred since he was diagnosed. She is not sleeping well because more than once she has awakened during the night to find that Fred has turne..
Assignment on the marketing research : You have been hired by a firm making bar soap. They want to determine the market for soap made organically from natural ingredients. You have been asked to give a presentation based on your research. Your PowerPoint presentation should address the..
Describe an instance where a change in price moved : Describe an instance where a change in price moved you along your demand curve for a product. Describe an instance where a change in the price of a substitute changed your demand for a product.
How you manage stress in your life can modify the stress : How you manage stress in your life can modify the stress response and subsequent health consequences. Recall the Primary Appraisal and Coping chart from last week. Imagine your disruptive and argumentative mother-in-law has announced that she is c..

Reviews

Write a Review

Other Engineering Questions & Answers

  Describe the basis for a step response

Q1: A first order system was assessed using a step response method and was found to have a time constant of 1.5s. a) Describe the basis for a step response

  Determine the shape of shafts and the size of shafts

Briefly describe the mechanisms involved in the excavation of rock - What parameters are used when determining the shape of shafts and the size of shafts?

  Laver-shaft assembly

Problem 1: A force, F applied to a laver-shaft assembly as shown in the figure. F = 534 N. determine the scalar component of the moment at point O about line OB and the reaction at O.

  Analysis of systems with chemical reactions

This assignment focuses on the analysis of systems with chemical reactions. Be sure to follow the requirements for homework as posted to BB.Every problem should be well-documented with a brief problem statement (don't copy from this document, brie..

  Early computers were merely usable by experts with strong

early computers were only usable by experts with strong technical knowledge. examine how interactive systems have

  Create an interface

Create an interface that allows Alexander and Elizabeth to view the flowers in their pack. On this interface we should have an add button that adds new flowers

  How websites are blocked

How websites are blocked? And how its contents are identified?

  Define the purpose of vhdl program segments

Describe some of the differences between analog and digital electronics - List common products that can have either a digital or analog output.

  Impulse invariance method to convert the analog transfer

Impulse Invariance method to convert the analog transfer function, having repeated poles of order 'n' to digital transfer function - with solved examples.

  Dimension of the unit cell of andalusite crystal structure

What is happening to the a 0 dimension of the unit cell of the andalusite crystal structure, when it is being heated?

  Production data analysis

Objective of this task is to collect and obtain information on variables of interest in a systematic way to prepare the required data for studying the decline rates of Bakken wells.

  Describe the potential negative impacts on a small river

Describe the potential negative impacts on a small river downstream from where it receives a factory liquid waste discharge that has a high biological oxygen demand (BOD), as well as high nitrate and phosphate levels

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd