Python - Assignment Example

Comments (0) Cite this document
Summary
Method browseGroup() takes four arguments the first one being the name of the group that one is interested in browsing, the remaining three arguments are…
Download full paperFile format: .doc, available for editing
GRAB THE BEST PAPER96.7% of users find it useful
Python assignment
Read TextPreview

Extract of sample "Python"

Download file to see previous pages Before using methods of a classes that are user defined, it is necessary to create an object which will temporarily hold values returned by the various methods of the associated class. bFiles is created to facilitate calling of the two methods of BrowseFiles.
After variable and object declarations and initialization, the files containing the group of words to use for the game are read into the program using the open() method and stored in variables f1, f2, and f3 as shown in the file above. This program has used only three input files, however more files can be reead into the program when a method to read files is defined. The three for loops then loop through each file adding each word to a group according to its file.
Once all the files have been loaded into the program and assigned to different groups, suggested management activities can be performed upon them. To browse the groups available, a user is asked to choose one of the groups so that its contents can be displayed. Using the object created BrowseFiles method browseGroups is called and given the user value for the group together with the groups as arguments. It then prints the words under the specified group. Deletion is done in the same way where the delGroup() is called and given the group name to delete. Fig.1.0. illustrates these activities.
First important variables are declared: choice holds the string of words entered by user, score holds the number of words from the user choice that are present in the group chosen while score_record holds the score together with the timestamp of when it was created.
The game prompts the user to enter the name of the group from which the jumbled words should be extracted. The group is then returned containing the words in reverse. The user is then prompted to enter the words that they can make out from the list. The loop checks each of the words against the original group and increments the ...Download file to see next pagesRead More
Cite this document
  • APA
  • MLA
  • CHICAGO
(“Python assignment Example | Topics and Well Written Essays - 1500 words”, n.d.)
Python assignment Example | Topics and Well Written Essays - 1500 words. Retrieved from https://studentshare.org/information-technology/1669178-python-assignment
(Python Assignment Example | Topics and Well Written Essays - 1500 Words)
Python Assignment Example | Topics and Well Written Essays - 1500 Words. https://studentshare.org/information-technology/1669178-python-assignment.
“Python Assignment Example | Topics and Well Written Essays - 1500 Words”, n.d. https://studentshare.org/information-technology/1669178-python-assignment.
  • Cited: 0 times
Comments (0)
Click to create a comment or rate a document

CHECK THESE SAMPLES OF Python assignment

Python Programming Language

...?PYTHON PROGRAMMING LANGUAGE Python Programming Language Affiliation Table of Contents Table of Contents 2 Introduction 3 Python 3History of Python 4 Design Goals 5 Implementations 6 Python Advantage 7 Scripting Languages 7 Python is Easy to use 8 Python is simple 8 Python is safe 9 Object-oriented programming Support 9 Python is fun 10 Python is practical 11 System administration of Linux through Python 11 Python and Linux 11 Modules 12 Python Administration 12 Linux System administration Characteristics 13 Linux System...
15 Pages(3750 words)Essay

Web technologies.From PHP to Python

...An aspect of software technology that is relevant to interactive web sites for use in E-business Introduction: The following web technologies will pave the path to capture business functions and the later in turn must exploit the technology created by the intellectuals to cater their requirements. It navigates to PHP and then moves down to Python. PHP What is PHP PHP ("Hypertext Preprocessor") is a extensively used Open Source general-purpose scripting language which is especially suited for Web development and can be embedded into HTML pages. The distinguishing factor of PHP from client-side languages like JavaScript is that the code is executed on the server. If you were to have a script similar to the above on your server... ...
21 Pages(5250 words)Essay

Programming using Python

...: s = s + " " i=i+1 print s 2(c). for i in range(100): if i %2 == 0: print i , "is even " else : print i , "is odd " 2(d). The following code below will execute but is logically incorrect, because for loops don't allow zero step increment to produce an infinite loop, However the counter variable is assigned zero inside the loop. char="" print "press tab enter to stop Python being cool ." print " Press any key then Enter to keep Python cool ." for i in range (0,2): i=0 print " Python is cool !" char = raw_input () if char == "t": exit 3(a). In the given example, the 'while' loop can never begin execution as it's condition can...
13 Pages(3250 words)Essay

Monty Python Grail Video

...YOUR August 12, Monty Python Grail Video The Monty Python Grail Government video casts an interesting light on several of the topics we have discussed in this class. Two of the most prominent are relativism and the role of religion in government. Relativism, in general, is the idea that there is no one objective truth, but that everything is relative to the speaker’s viewpoint. In other words, our perceptions of what goes on around us makes us see things different to how others perceive them. This is seen in the video through the way King Arthur and the peasant interpret things so differently, from his right to rule down to how people should be treated. They also clearly have different ideas about...
1 Pages(250 words)Essay

Compare PHP and Python

...for admin: The does not require references; therefore, I have not included them. Dear Please delete this before submitting Introduction It is pertinent to state some facts and figures of both the languages including Python and PHP before stating my opinion and experience with these languages. Originally, PHP stands for Personal Home Page, however, now it is known as Hypertext Preprocessing. The PHP is a server side scripting language (the script language support run time environment and their scripts interprets rather than compiles), usually utilized for the development of web applications; however, it is also used for developing general purpose applications. Initially, the PHP was developed by Rasmus Lerdorf around...
4 Pages(1000 words)Essay

Monty python and the Holy Grail

...Monty python and the Holy Grail Monty python and the Holy Grail is a film which narrates the legend of King Arthur and his quest to find the Holy Grail. On his way together with his knights, they find many things and revelations. The swimmer, according to Cheever's Dark Knight of the Soul: The Failed Quest of Neddy Merrill is a character related to the Holy Grail by the imagery use of the cup and the quest for an unknown cause. The two essays have a connection because both are about characters in a quest for the Holy Grail. In the Monty python essay, King Arthur and his Knights are made symbols of the dark times by the challenge they are given by God, to find the Holy Grail. They go...
6 Pages(1500 words)Essay

The program is called Python Though

...Lab Report Electric field By: Physics (including Earth and space sciences Events in the Experiment The experiment involves the simulation of calculations and plotting of electric field from the center of the rod. As it was observed, the electric field grows weaker as the distance widens. One of the measurements was done with the single rod with the electric charge perpendicular to and at the center of the rod. This was plotted as shown in figure 1 below. Figure 1: Electric Field with with charge at the centre of the rod The second measurement experiment was conducted with the rod broken into a number of pieces. As the number of pieces increased, electric field calculation remained constant, but the numerical value increased... Report Electric ...
1 Pages(250 words)Lab Report

Classes and methods in Python

...a method that is invoked when object is instantiated. Its symbol is _init_ Example: # inside class Time: def __init__(self, hr=0, min=0, sec=0): self.hour = hour self.minute = minute self.second = second The _str method _str is a method that returns a string representation to an object. Example: # inside class Time: def __str__(self): return %.2d:%.2d:%.2d % (self.hour, self.minute, self.second) When you press print an object python invokes the str method Outcome: >>> time = Time(9, 45) >>> print time 09:45:00 Operator overloading This refers to changing the behavior of an operator so as it work with user-defined types. Operators in python usually have a...
1 Pages(250 words)Essay

Creating of a Product in Python

...INDIVIDUAL REFELECTIVE STATEMENT COVER SHEET Reflective Statement Our group comprising of six members Dias (me), Jason, Yasin, Richard, Mobin, and Alex was asked to create a product in Python 3.3. The purpose of the product was to demonstrate data gathering and analysis. Every individual in the group had their role to play. My role in the projects was writing the python code. The task was challenging, but I managed to pull it off and provide the team with a functional code. The reason for choosing this responsibility is because after we assessed the weaknesses and strengths of every team member, I have more experience and knowledge about Python programming language....
6 Pages(1500 words)Assignment

The source Code for the implementation of Python

...work, Logic and Programming Software Development – Python Implementation The program was implemented by importing each ofthe three CSV data files into the SQLite database and then manipulating them in python by use of SQL commands. The source Code for the implementation is presented below: 1.1. Using data File 3333658a.csv 1.1.1. Source Code: import sqlite3 connection = sqlite3.connect("data2.db") cursor = connection.cursor() cursor.execute ("SELECT avg (channels) as Avchannel FROM table2") print ("Averages Channel:") result = cursor.fetchall() for r in result: print (r) cursor.execute ("SELECT count (invest) FROM table2") print ("\nCount of Nows:") res = cursor.fetchall() print...
15 Pages(3750 words)Coursework
sponsored ads
We use cookies to create the best experience for you. Keep on browsing if you are OK with that, or find out how to manage cookies.

Let us find you another Assignment on topic Python assignment for FREE!

Contact Us