Computer Science  >  QUESTIONS & ANSWERS  >  Test 2: Edhesive Questions & Answers (All)

Test 2: Edhesive Questions & Answers

Document Content and Description Below

Test 2: Edhesive Questions & Answers Which line of code outputs the decimal portion of a float stored in the variable x? - ✔✔print (x - int(x)) Three of the following values could be stored as ... strings. When would you NOT use a string command? - ✔✔To store decimal values. Consider the following code: x = int(input("Enter a number: ")) print (x) What happens if the user types in A? - ✔✔It prints 65. Which of the following is NOT a data type in Python? - ✔✔decimal Which of the following numbers might this code generate: random.randint(1,9)? - ✔✔1 What is NOT a built-in function in python? - ✔✔string() To generate integers between and including -10 to 10 you would use: - ✔✔random.randint(-10, 10) Consider the following code: a = 3 b = 2 print (a ** b) What is output? - ✔✔9 What is output? print (12 % 5) - ✔✔2 Consider the following code: x = 9 y = -2 z = 2 print (x + y * z) What is output? - ✔✔5 You need to find the square root of a value. Which of the following functions would you use? - ✔✔sqrt You need to make sure a number the user types in is non-negative. Which of the following functions would you use? - ✔✔fabs Consider the following code: x = 5 x = x * 3 print (x) What is output? - ✔✔15 The following code is intended to find the average of three numbers entered from the keyboard. What is wrong with the code? print ("Enter 3 numbers: ") n1 = float(input ("Enter a number: ")) n2 = float(input ("Enter a number: ")) n3 = float(input ("Enter a number: ")) print (n1 + n2 + n3 /3) - ✔✔The code is missing parentheses around n1 + n2 + n3 in the last line. What is the output for the following? x = 7 print ("The number is: " + x * 2) - ✔✔None, there is an error. Which of the following calculates to 10? - ✔✔(3 * 6 + 2) /2 Which of the following would be the best variable name to store the value of your English letter grade? - ✔✔letter_Grade Why can it be helpful to perform mathematical calculations using programming? Choose the best answer. - ✔✔Because computers can quickly do calculations much larger and complex than humans. Consider the following code: x = 19 y = 5 print (x % y) What is output? - ✔✔4 Consider the following code: print (min("whom", "carton", "landform", "apron", "deposit", "become")) What is output? - ✔✔apron Function - ✔✔A collection of commands given a name, for example, input( ).? Module - ✔✔A collection of code and functions that perform similar tasks. Modular Division - ✔✔A calculation which gives the remainder of integers which have been divided. Min - ✔✔Command that finds the smallest value in a set of values. Big Data - ✔✔Data sets that are too large and complex for traditional data processing applications. Max - ✔✔Command that finds the largest value in a set of values. Assignment - ✔✔The process of storing a value in a variable. Terabyte - ✔✔2^40 or one million million (10^12) bytes. Import - ✔✔Command that pulls in code to add functions to your code. random - ✔✔A module used to create random numbers in programs. The numbers generated are not really random. Operator - ✔✔A symbol that defines a math operation. [Show More]

Last updated: 3 years ago

Preview 1 out of 4 pages

Buy Now

Instant download

We Accept:

Payment methods accepted on Scholarfriends (We Accept)
Preview image of Test 2: Edhesive Questions & Answers document

Buy this document to get the full access instantly

Instant Download Access after purchase

Buy Now

Instant download

We Accept:

Payment methods accepted on Scholarfriends (We Accept)

Reviews( 0 )

$8.00

Buy Now

We Accept:

Payment methods accepted on Scholarfriends (We Accept)

Instant download

Can't find what you want? Try our AI powered Search

103
0

Document information


Connected school, study & course


About the document


Uploaded On

Dec 15, 2022

Number of pages

4

Written in

All

Seller


Profile illustration for Nutmegs
Nutmegs

Member since 4 years

607 Documents Sold

Reviews Received
77
14
8
2
21
Additional information

This document has been written for:

Uploaded

Dec 15, 2022

Downloads

 0

Views

 103

Document Keyword Tags


$8.00
What is Scholarfriends

Scholarfriends.com Online Platform by Browsegrades Inc. 651N South Broad St, Middletown DE. United States.

We are here to help

We're available through e-mail, Twitter, Facebook, and live chat.
 FAQ
 Questions? Leave a message!

Follow us on
 Twitter

Copyright © Scholarfriends · High quality services·