What information does the interpreter give

Assignment Help Python Programming
Reference no: EM131782383

Question: The dir() built-in function.

(a) Start up the Python interpreter. Run the dir() built-in function by simply typing "dir()" at the prompt. What do you see? Print the value of each element in the list you see. Write down the output for each and what you think each is.

(b) You may be asking, so what does dir() do? We have already seen that adding the pair of parentheses after "dir" causes the function to run. Try typing just the name "dir" at the prompt. What information does the interpreter give you? What do you think it means?

(c) The type() built-in function takes any Python object and returns its type. Try running it on dir by entering "type(dir)" into the interpreter. What do you get?

(d) For the final part of this exercise, let us take a quick look at Python documentation strings. We can access the documentation for the dir() function by appending ".__doc__" after its name. So from the interpreter, display the document string for dir() by typing the following at the promt: print dir.__doc__. Many of the built-in functions, methods, modules, and module attributes have a documentation string associated with them. We invite you to put in your own as you write your code; it may help another user down the road.

Reference no: EM131782383

Questions Cloud

What voltage would be genera ted at 200 hz : Assuming that 3 mV (rms) is the accuracy limit of the instrument, determine the upper frequency limit of the instrument for 1 g excitation.
Is the onus on leaders and/or followers to adapt : Depending on the culture, adaptability may be considered a virtue or a weakness. Is the onus on leaders and/or followers to adapt?
Find the sales tax of a new above ground pool : Find the sales tax of a new above ground pool that you pay $14,900 for, if the tax rate in your area is 9.0%.
Determine its voltage output per : It is used with a vacuum-tube voltmeter with connecting cable 5 m long with a capacitance of 50 pF/m. Determine its voltage output per g.
What information does the interpreter give : You may be asking, so what does dir() do? We have already seen that adding the pair of parentheses after "dir" causes the function to run.
Peter inherited a mountain cottage from her grandmother : Peter inherited a mountain cottage from her grandmother. The cottage was worth $66K at the time & had a basis to the grandmother
Determine the amount of expenses walton will report : Determine the amount of expenses Walton will report relative to the lease for 2011 and the amount of revenue Mullen will report for the same period
How many questions did mario answer correctly : Erick answered 30% of the questions correctly. The test contained a total of 80 questions. How many questions did Mario answer correctly?
Show that the structural damping factor is equal to loss : For a system with hysteresis damping, show that the structural damping factor Y is equal to the loss factor at resonance.

Reviews

Write a Review

Python Programming Questions & Answers

  Write a program using the ''requetinteger''

using python/jython programming write a program using the 'requetInteger' function that will ask the user to type a value that will draw a line from one point on a picture to another. I don't need specific help just a gerneral idea.

  Implement a class called countrycatalogue

Implement a class called CountryCatalogue. Implement a class Country that holds the information about a single country; name the file country.py.

  Programmer does not have to use the def statement

Unlike Z+-, the programmer does not have to use the DEF statement to create a variable. Instead, the programmer can simply use the variable. The first use of the variable creates it and initializes it to 0.

  Write another python program to decode the encoded message

Write another Python program to decode the encoded message according to the "circular Caesar cipher" problem presented in Programming Exercises 7 and 8 of Book Chapter 5.

  Design part of the code for the haunted house game

Create a cheat commands in the game so player can teleport to any location in the map - You are tasked with improving and designing part of the code for the Haunted House game.

  Write a python program that generates a small web site

ICT112 Assignment - Generated Web Site for Sports Club. Your task is to write Python program that generates small web site for local sports club

  Write a while loop that prints all squares less than n

Introduction to Programming Concepts Python. Write a while loop that prints All squares less than n. For example, if n is 100, print 0 1 4 9 16 25 36 49 64 81.

  Write a function trans(m) which returns the transpose

Write a function trans(M) which returns the transpose of an n-by-n matrix M. The matrix M is represented by a list of n lists, each of length n. Transposing M means that each M[i][j] is swapped (once!) with M[j][i].

  Email spam filter

Analyze the emails and predict whether the mail is a spam or not a spam - Create a training file and copy the text of several mails and spams in to it And create a test set identical to the training set but with different examples.

  Find a random number import random

Find a random number import random - you are responsible for completing the program by adding the proper

  1 one factor that leads to a decline in biodiversity is the

1. one factor that leads to a decline in biodiversity is the introduction of non-native species. however most species

  Write a python program that generates a small web site

Write a Python program that generates a small web site for a local sports club. It will read some input data from a text file

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