Loading...
「ツール」は右上に移動しました。
利用したサーバー: wtserver1
6いいね 323 views回再生

Python Homework Excuser - How to Read Input Files into Arrays and Randomly Select an Array Item

Subscribe to our Channel to get regular Video Lessons in Python Programming.

Because we are a slow talker, we recommend you use the YouTube "Tools Cog" on the player bar to watch the video at a speed of 1.5x or even 1.75x.

In this Lesson we learn about How To Read an External Text File into an Array in Python by making a Fun Homework Excuses Program.


Resources Download Link:
https://tinyurl.com/tnbfpl2

You do not have to use PyScripter for our Course. All of the program code will run in Python 3.7 or higher.
So if you want to use other popular Python IDE’s like PyCharm or MU, that will be okay.

In this Python Lesson we create a program that provides a random Excuse for not doing your Homework.

There is also a Challenge Task where you will make a program to provide a Random Horoscope Prediction.

The Python Learning which this Lesson will provide is:

How to create a simple text Input File using Windows Notepad.
How to Read the Input File Line By Line into a Python Program.
How to place each line of the Input File into an Array in Program Memory.
How to make sure a File exists before trying to read it,to avoid a Program Crash.
How to extract a Random Item from the Array using Python Specific Programming.
Review Using the Agile Methodology and Pseudocode to Develop Programs.


Using logically organised subroutine driven from a Main Process is a critical part of programming in all computer languages.
It is vitally important to study and understand the program code, as well as the organisation structure of the program.

The learning here will be essential for future Python Programming Lessons we will be progressively adding to our Channel.

Because we are a slow talker, we recommend you use the YouTube "Tools Cog" on the player bar to watch the video at a speed of 1.5x or even 1.75x.

If you are a Teacher watching this video then click the downloads link and get all of the lesson materials for your students.
These Downloads include detailed Step by Step Instructions including Pseudocode and a Challenge Task, as well as the Input Text Files to save students typing time.
https://tinyurl.com/tnbfpl2

Give these resources to your students and we think you will find that some of them will "get it" very quickly. The other students need to watch this video which goes through everything in full detail slowly step by step with repetition of examples.

This is a detailed video, if you want to fast track learning, then just Download and quickly work through the PDF of Step by Step Instructions using the Link given further down below.

There is also an Introduction and Overview PDF document giving a set of Learning Objectives for the Lesson included in the Lesson Downloads.

Then for anything you do not fully understand in these two documents, simply use the Timeline Index below to go and watch the relevant section of Video explanation.

If you have the time it will be extremely beneficial to watch the entire video to maximize learning outcomes.

VIDEO TIMELINE INDEX:

(Click on the time number to jump to that section of the video).

00:00 to 02:12 Introduction and Preview of Finished Program
02:12 to 03:41 Using Windows Notepad to make an Input Text File
03:41 to 05:19 How to Read an Input File Line By Line into an Array
05:19 to 06:30 Learning Objectives for this Lesson
06:30 to 08:16 Preview of Challenge Task (Featuring Murphy the Puppy)
08:16 to 11:40 V1-Read Input File and Load its Lines into an Array
11:40 to 15:10 V2–Avoiding File Not Found Program Crash
15:10 to 18:00 V3–Remove the Debug Print and Get User Input
18:00 to 20:43 V4–Finishing the Program using Supplied Pseudocode
20:43 to 23:04 Two ways of Randomly Selecting an item from an Array
23:04 to 23:48 Fixing a Bug for the last Excuse Line in the Array.
23:48 to 24:33 Challenge Task - Horrible Horoscopes
24:33 to 25:04 Our Website Python Programming Course
25:04 to 25:41 Video Wrap Up and Outro


This video will be useful for anyone learning Computing, especially students doing VCE Applied Computing or VCE Software Development or HSC Computing high school courses in Australia, and GCSE in the UK.

Check with your Teacher or Instructor before getting any Downloads from our Website, as they may already have these materials for you.

You can download a hard copy of the Step By Step Instructions Guide, and the Full Program Code at the following link:
https://tinyurl.com/tnbfpl2

Check with your Teacher or Instructor first, as they may already have these Download materials for you.

You can check out our full Python Programming Course at the following link:
http://passyworldofict.com/python

We are planning to make a number of Structured Programming Videos that will be a great course for people to learn how to Program in Python.

Like this video if you found it helpful.

Subscribe to our Channel to get notified of our weekly video updates.

Enjoy,
Passy

コメント