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

  Write a python program to implement the diff command

Without using the system() function to call any bash commands, write a python program that will implement a simple version of the diff command.

  Write a program for checking a circle

Write a program for checking a circle program must either print "is a circle: YES" or "is a circle: NO", appropriately.

  Prepare a python program

Prepare a Python program which evaluates how many stuck numbers there are in a range of integers. The range will be input as two command-line arguments.

  Python atm program to enter account number

Write a simple Python ATM program. Ask user to enter their account number, and print their initail balance. (Just make one up). Ask them if they wish to make deposit or withdrawal.

  Python function to calculate two roots

Write a Python function main() to calculate two roots. You must input a,b and c from keyboard, and then print two roots. Suppose the discriminant D= b2-4ac is positive.

  Design program that asks user to enter amount in python

IN Python Design a program that asks the user to enter the amount that he or she has budget in a month. A loop should then prompt the user to enter his or her expenses for the month.

  Write python program which imports three dictionaries

Write a Python program called hours.py which imports three dictionaries, and uses the data in them to calculate how many hours each person has spent in the lab.

  Write python program to create factors of numbers

Write down a python program which takes two numbers and creates the factors of both numbers and displays the greatest common factor.

  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.

  Improve the readability and structural design of the code

Improve the readability and structural design of the code by improving the function names, variables, and loops, as well as whitespace. Move functions close to related functions or blocks of code related to your organised code.

  Create a simple and responsive gui

Please use primarily PHP or Python to solve the exercise and create a simple and responsive GUI, using HTML, CSS and JavaScript.Do not use a database.

  The program is to print the time

The program is to print the time in seconds that the iterative version takes, the time in seconds that the recursive version takes, and the difference between the times.

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