What is the difference between a for loop and a while loop

Assignment Help Python Programming
Reference no: EM131325305

QUESTIONS FOR PYTHON PROGRAMING (answer each question with at least 5 sentences)

1. Discuss the basic elements of a computer program and how they are put together. (Hint: If you write a paper for class, the elements are words, sentences, paragraphs, and sections, and they are put together in a variety of ways. A program has a similar structure.)

2. What is Python? How is it used?

3. Discuss the use of variables, expressions, statement and indentation in Python.

4. Python has a group of standard (built-in) functions in its library which can be used for programming tasks. What are the advantages of working with built-in functions vs. your own functions in a project?

5. Explain how to use built-in functions, functions from module, and user-defined functions.

6. What is the difference between a for loop and a while loop?

7. What is the difference between elif and if-else?

8. Discuss looping statement/repetitive statement (i.e., For, While) available in Python. How do commands "break" and "continue" work inside a loop?

9. Discuss the application of data types: lists and tuples and strings.

10. What is a class, a method, a self? What is the relationship between classes and objects? Use examples to demonstrate. What is meant by the methods associated with a class/object? How do they relate to object-oriented programming?

11. How does one define a new class and its methods? Which methods are inherited if no new methods are redefined?

Reference no: EM131325305

Questions Cloud

How far would prices need to move against the position : If the initial margin for one contract of crude oil was $1,000 and the maintenance level was $800, how far would prices need to move against the position in order to trigger a margin call?
What are the differences and connections between these two : Do some research on Java application and Java applet. What are the differences and connections between these two? To find out, you might need to be more resourceful than usual.
What type of order is the best to use : If you wish to protect yourself from falling prices, what type of an order would be the best to use?- If you wish to protect yourself from rising prices, what type of order is the best to use?
Coral bleaching problem in australia : 1) In your own words find 5 solutions for the coral bleaching problem in Australia. 2) Also in your own words find 2 solutions for coral bleaching across the planet.
What is the difference between a for loop and a while loop : Explain how to use built-in functions, functions from module, and user-defined functions. What is the difference between a for loop and a while loop? What is the difference between elif and if-else?
Access a playlist of videos oncurrent developments : Use the following link (http://www.ted.com/playlists/144/should_we_redesign_humans) to access a playlist of videos oncurrent developments in synthetic biology.
Which type of order should you use : If you own an option and would like to sell it if the futures reach a certain price, which type of order would you use?
Discuss transactional collective bargaining and summarize it : Most unions have opposed free trade agreements, such as NAFTA. On the other hand, most employer lobbying groups have supported such agreements. Is each side's viewpoint justified? Multinational corporations and transactional collective bargaining ..
Write a conclusion that reaffirms the thesis statement : In this assignment, you will refine that thesis even further and develop your argument. You are required to incorporate your instructor's feedback in your Final Paper and to take peer feedback into consideration.

Reviews

Write a Review

Python Programming Questions & Answers

  Explain a python program storing and processing simple bank

A Python program storing and processing simple bank records is in the early stages of development. The records are stored in a text file (bank.txt) that contains, for each bank customer, their given name, account number and balance.

  Specializes in solving the equations ax=b by doolittle''s dec

Write a  program that specializes in solving the equations Ax=b by Doolittle's decomposition method, where a is the HIbber matrix of arbitrary size nxn

  Do a python project and get it running using app engine

Do a python project and get it running using App engine. Something very basic and simple

  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

  Assume an n × n matrix a is given

Assume an n × n matrix A is given, containing only 1's and 0's, such that, in each row, all 1's come before all 0's. Give an O(n log n) algorithm to count all 1's in A.

  Which stores and manipulates times on a 24 hour clock.

Complete the class Time, which stores and manipulates times on a 24 hour clock. As specified below, write the required methods, including those needed for overloading operators. Exceptions messages should include the class and method names, and ident..

  Segment that prompts the user for an arithmetic operator

The variables x and y refer to numbers. Write a code segment that prompts the user for an arithmetic operator and prints the value abtained by appying that operator to x and y.

  Implements the binary tree as a class

Implements the binary tree above as a class. Divides into tokens, generating an iterator, with added support for variable names. Evaluates a postfix expression, given an iterator, with added support for variables.

  Determines number of occurrences of a given letter in string

In this last checkpoint, you will write a new program that determines the number of occurrences of a given letter in a string. To do so, you are only allowed to use the replace() and len() functions.

  Provide the code for a boolean-valued function

Provide the code for a Boolean-valued function perfect(n)that calculates and returns the Boolean value True or False according to whether the value of the parameter n is a perfect number or not, respectively

  How many times each word has occurred in the text file

The values in this dictionary should be a count of how many times each word has occurred in the text file. Second, add the word into a data structure that is keeping track of word information for the completion process.

  How a vertical scroll bar is associated with a list box

What are instance variables, and what role does the name ‘self' play in the context of a class definition. Describe how a vertical scroll bar is associated with a list box.

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