Question

1. import sys → What does this line of code do? 2. sys.getsizeof(object) → what does...

1. import sys → What does this line of code do?

2. sys.getsizeof(object) → what does the following method do?

3. Place python source code in your shell and test.

data = 10

sys.getsizeof(data)

data = 100000

sys.getsizeof(data)

data = 100000000

sys.getsizeof(data)

what happens when you run the above code?

             data = 10.0

sys.getsizeof(data)

data = 100000.5

sys.getsizeof(data)

data = 100000000.5

what happens when you run the above code?

4. Please describe the why floats and doubles in Python or so much larger than floats or doubles in C++

5. what are the difference between convention, gray and syntax?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Please Note:
As per Chegg Answering Guidelines, I should answer the first question. I have answered 2 questions here.
Please Re-Post for the other Questions.


1. import sys

Answer)
sys is meant for specific parameters and functions which is a module which provides access to the variables used or maintained by the interpreter and to the functions which are responsible for strongly interacting with the interpreter. These are in the sys.argv. The import sys statement import all these to be used in the script.

2. sys.getsizeof(object)

sys.getsizeof(object) returns the size of the object in bytes. The object which can be passed in the method can be of any type of object and sys.getsizeof(object) returns the memory size of the object.

Add a comment
Know the answer?
Add Answer to:
1. import sys → What does this line of code do? 2. sys.getsizeof(object) → what does...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • This is my code: import numpy as np import pandas as pd import sys from keras.models...

    This is my code: import numpy as np import pandas as pd import sys from keras.models import Sequential from keras.layers import Dense from sklearn.preprocessing import StandardScaler from keras.layers.normalization import BatchNormalization from keras.layers import Dropout file_full=pd.read_csv("/Users/anwer/Desktop/copy/FULL.csv") file_bottom=pd.read_csv("/Users/anwer/Desktop/copy/bottom.csv") train=[] train_targets=[] test=[] test_targets=[] p=[] q=[]    # We will generate train data using 50% of full data and 50% of bottom data. #is train target for labeling ? yes for train data train_df = file_full[:len(file_full)//2] labels=[ 0 for i in range(len(file_full)//2)] train_df=train_df.append(file_bottom[:len(file_bottom)//2]) for...

  • 1. Questions Python Code: For each line of code, write the type of error (syntax, semantics,...

    1. Questions Python Code: For each line of code, write the type of error (syntax, semantics, runt-time), cause of the error, and your fix. (1) def fun(num letter) (2) num == 7 + num (3) return 'num' - letter (4) result = fun(5, x) 2. Question Python Code: Run the code below to check the outputs of the print() call on lines 12. And : A) Analyze the application of the accumulation pattern and answer the following questions: #1. a....

  • import java.util.List; import java.util.ArrayList; import java.util.LinkedList; public class ListPractice {       private static final int[]...

    import java.util.List; import java.util.ArrayList; import java.util.LinkedList; public class ListPractice {       private static final int[] arr = new int[100000];    public static void main(String[] args) {        for(int i=0; i<100000; i++)            arr[i] = i;               //TODO comment out this line        LinkedList<Integer> list = new LinkedList<Integer>();               //TODO uncomment this line        //List<Integer> list = new ArrayList<Integer>();               //TODO change the rest of the...

  • Python3 : question about object-oriented programming, Please write program in the template(critter.py),specific information is on the graphs the missing words in the 4th line are 'To save an attri...

    Python3 : question about object-oriented programming, Please write program in the template(critter.py),specific information is on the graphs the missing words in the 4th line are 'To save an attribute, attach it to this self keyword' W11 - Critters Implement the Critter class. Each critter C has attributes species, size, and age The constructor accepts arguments for the attributes above, in the order above. You can expect size and age to be numeric values Each critter C has a can_eat) method,...

  • What will be printed upon running following code: alist = [3, 50, "Kity", [50, 52, "Rover"],...

    What will be printed upon running following code: alist = [3, 50, "Kity", [50, 52, "Rover"], [ ], 3.14, False, 'a'] print(len(alist[3]))alist = [3, 50, "Kity", [50, 52, "Rover"], [ ], 3.14, False, 'a'] print(len(alist[3])) 8 7 2 an error 3 Select the best reason why the code below returns True, False, False respectively? a = 256 b = 256 print(id(a) == id(b)) c = 5.1 d = 5.1 print(id(c) == id(d)) x = 257 y = 257 print(id(x) ==...

  • circle the correct answer please. Please reply Asap. 8. What does the following jQuery code do?...

    circle the correct answer please. Please reply Asap. 8. What does the following jQuery code do? s ("inage").attr(are", imagoURL) a Gets the value of the sre aribute for the element with an id of "image" and stores it in a variable named imageURL Sets the value of the sre attribute for the element with an id of "image" to the value in a variable named imageURL Gets the values of the sre attribute for each element with a class of...

  • 3. What does this code do? Write an explanation in English python n=1 while (n <1000):...

    3. What does this code do? Write an explanation in English python n=1 while (n <1000): print(n) n-n

  • #Get the filepath from the command line import sys P= sys.argv[1] F= sys.argv[2] L= sys.argv[3] B=...

    #Get the filepath from the command line import sys P= sys.argv[1] F= sys.argv[2] L= sys.argv[3] B= sys.argv[4] # # Our Helper functions: # # Loads the file at filepath # Returns a 2d array with the data def load2dArrayFromFile (filepath): # Your code goes here: 1 2 23 # # Searches the 2d array 'records' for firstname, lastname. # Returns the index of the record or -1 if no record exists 24 25 # def findIndex ( records, firstname, lastname)...

  • Python Code Question# 1 General Instructions Create a class called LawnService that takes in the length...

    Python Code Question# 1 General Instructions Create a class called LawnService that takes in the length and width of a yard, along with the current state of the yard. The currect state can be: poor, acceptable or great. Within this class include a constructor that will assign these values to attributes. Additionally create three methods that will be named and do the following: *DetermineApplication: This method will focus on the lawn status attribute. If the status is poor, the lawn...

  • Analyze the code to determine what the code does, how the data is structured, and why...

    Analyze the code to determine what the code does, how the data is structured, and why it is the appropriate data structure (i.e. linked list, stack or queue). Note that these are examples of classes and methods and do not include the "main" or "test" code needed to execute. When you are done with your analysis, add a header describing the purpose of the program (include a description of each class and method), the results of your analysis, and add...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT