Python 101 Dr. Bernard Chen University of Central Arkansas PyArkansas.

Slides:



Advertisements
Similar presentations
Chapter 19, 20 Object Oriented Programming (OOP) Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2012.
Advertisements

Huffman Encoding Dr. Bernard Chen Ph.D. University of Central Arkansas.
Genome Sciences 373 Genome Informatics Quiz Section 4 April 21, 2015.
Homework 4 Example Bernard Chen How do we generate Random number in Python Random is a very important method in math and statistics, how could we.
Chapter 9 IF Statement Bernard Chen. If Statement The main statement used for selecting from alternative actions based on test results It’s the primary.
Chapter 9 IF Statement Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2012.
Computer Science: A Structured Programming Approach Using C1 3-7 Sample Programs This section contains several programs that you should study for programming.
Introduction to Python Dr. Bernard Chen Ph.D. University of Central Arkansas July 9 th 2012
Introduction to Python Lecture 1. CS 484 – Artificial Intelligence2 Big Picture Language Features Python is interpreted Not compiled Object-oriented language.
0-12 Mean, Median, Mode, Range and Quartiles Objective: Calculate the measures of central tendency of a set of data.
What is SharePoint? Module 1. Module Overview  Defining SharePoint  Understanding How SharePoint is Used  Interacting with SharePoint.
Python 101 Dr. Bernard Chen University of Central Arkansas IT Academic.
SharePoint 2010 Development Environment A Guide to Setup SharePoint 2010 Development Environment on Windows 7 Machine.
Introduction to Programming Workshop 1 PHYS1101 Discovery Skills in Physics Dr. Nigel Dipper Room 125d
Introduction to Python 2 Dr. Bernard Chen University of Central Arkansas PyArkansas 2011.
Chapter 3 Basic Statistics Section 2.2: Measures of Variability.
Game development tools for non- programmers Petar Todorov.
Database Technology and Church Management MSCM 8630 IT for Church Management Dr. Wagner October 9, 2008.
6.5 Applying Averages Obj: To calculate average and solve problems with average Find Average = Sum # of items.
Choose your songChoose your song  Choose one of your favorite songs  Pick one with clean lyrics or the clean version  Use the free music resources.
5 or more raise the score 4 or less let it rest
Xin Liu Jan 30, * By default, input() read a string from keyboard * This can be changed with an indirection operator ‘
JADE: agents insights Fabiano Dalpiaz Agent-Oriented Software Engineering (AOSE)
Ch. 10 For Statement Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2012.
ACTIVE V PASSIVE VERBS Tutorial.
Click on the link below statement.html statement.html Very good site.
The Power of Computer Coding for Elementary GT Students a hands on workshop Ann E. Durkin – Technology/Gifted and Talented Teacher, Johnson Elementary/
Pocket Code (the app): Pocket Paint (tool for creating images):
Final Review Dr. Bernard Chen University of Central Arkansas Spring 2012.
Python 101 Dr. Bernard Chen University of Central Arkansas PyArkansas.
Tux Guitar By Joseph Blackwell. What the programme is and what it is used for It is clear that this programme is used for music players and such others.
Introduction to Taverna Online and Interaction service Aleksandra Pawlik University of Manchester.
How to solve ? Mean & mode problems.
Proposal for a DFCS Learning Object Repository For Use by Training Center Coordinators.
Trinity College Dublin, The University of Dublin GE3M25: Computer Programming for Biologists Python, Class 4 Karsten Hokamp, PhD Genetics TCD, 01/12/2015.
7:56 AM PURSE :56 AM Try to use these templates to prepare your presentations This is a template slide embedded with time in lower right corner.
Chapter 15. Modules Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2012.
Download class materials onto your desktop… as usual.
Finding the Mean David R. David N.. Mean The average of the numbers in a set of data is the mean.
XYZCS Designing Binary Adders with decoders C(X,Y,Z) =  m(3,5,6,7) S(X,Y,Z) = S m(1,2,4,7);
CSC 411/511: DBMS Design Dr. Nan WangCSC411_L12_Oracle10g_JDBC 1 Application Development (JDBC)
Sprint 2 Goal Collect enough log files for calculation Automate processes to extra data (user, session, byte, and error counts) and convert them into excel.
Group collaborative Projects: TECHNOLOGICAL TOOLS TO ASSESS INDIVIDUAL CONTRIBUTION.
Chapter 8: Open Source Web Applications phpMyAdmin Wordpress Coppermine phpBB.
Downloads Best Free Software PC - Filefisher.com
Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2012
YEAR 12 COMPUTER SCIENCE.
Downloading files over HTTP
Automation System For Checking Protein Prediction
Combinational Circuits
Partial Products Algorithm for Multiplication
Quicken Contact Support Number You need to have a good printing machine so that you can print the data files or reports that have been prepared.
How to install hp deskjet 3050 all-in- one printer j610 driver.
Quicken File Password Related Issues
Lecture 14 Z80 Application Program
Launch WooCommerce On Linode. Let’s start installing WooCommerce on Linode cloud servers going through this Linode tutorial.Linode tutorial.
WICS - Flappy Anteater Python Tutorial
10:00.
FLIPing the Essay Multigenre: 
Excel Formulas Made Easy
Unit 3 Review (Calculator)
How Presentation Teams Work
Introduction to Computer Science
I Have, Who Has TEMPLATE Printing these cards:
Calculate 9 x 81 = x 3 3 x 3 x 3 x 3 3 x 3 x 3 x 3 x 3 x 3 x =
Lecture 4 Psyc 300A.
Steps to perform the firmware update in your Tp-link Archer C7.
Dictionary basics Consider typing the word “infinite” in the Google search:
ECO/561T ECONOMICS The Latest Version A+ Study Guide ECO 561T Entire Course Link
Presentation transcript:

Python 101 Dr. Bernard Chen University of Central Arkansas PyArkansas

Files File is also one of built-in type in Python The built-in OPEN function creates a Python file object, which servers as a link to a file After calling open, you can read and write the associated external file

Common FILE operations Input=open(‘file_name.txt’, ‘r’) Output=open(‘file_name.txt’, ‘w’) Input.readlines() Input.close(); Output.close()

Split() function >>> string= ‘a b c d e’ >>> string.split() ['a', 'b', 'c', 'd', 'e']

File in Action Let’s try to read in a file!!

File in Action input=open('file.txt','r') all=[] for line in input.readlines(): temp=line.split() all.append(temp)

File in Action Then we can calculate the average score for each student

File in Action for i in range(len(all)): sum=0.0 for j in range(1,len(all[i])): sum=sum+int(all[i][j]) average=sum/5 print average

Python Official Sites Python Tutorial Python Official Site Download Python Latest Version