ICT
 
 
home search Contact
Lmarsden is a non-profit information site

Week 03: Computational Thinking - Introduction to coding

Class Task and Information

  • Lesson 01: Random Numbers + Duel Conditions (Condition1) && (Condition2)

    • Video Tutorial Files -= What to Do =-
      • You will need to view the video file and stop it along the way so you can implement, do what the video files shows you.
      • Remember: Information Action = KNOWLEDGE
      • Remember to save your work as you go.

      Practical Tutorial 01: Python - Random Numbers - Randint, Choice, Randrange 

    • Programming Tasks:

      • Task 01: Write a program to take in the year a person was born (e.g. 2001) and tell them if they are an adult or not. 


      • Task 02: Roll at dice (random number between 1 and 6) and show the user the number and tell them if the number is odd or even.




      • Task 03: Roll 2 dice and tell the user if they have rolled 7's (sum of dice = 7) or "Snake Eyes" (double 1's).




      • Task 04: Simulate a the flipping of 2 coins and tell the user if the results are Heads, Tails or Odds (where you have an odd and an even).


      • Task 05: Using an elif statement create a program to calculate a students grade as a letter grade (A, B, C ...). Take in the test result and the maximum mark for the test and calculate the letter grade from the percentage.




    • Lesson 02: Fixed Loops and Conditional Loops
      • This lesson will give students opportunity to ask questions and revise.
      • During this lesson we will also check your programming progress.



      • Students will be look at the notes on: For Do Loop and the While Loop
      • Practical Tutorial 01: Python - Fixed Iteration - for do loop

        • Task 01: Create a Counter that will count from 1 to 50.



        • Task 02: Create a count down rocket launch program that will do
              • 10
              • 9
              • 8
              • .....
              • 1
              • Blastoff!!

            • Code snippet Hint: make the computer pause for 1 second.
              • import time
              • time.sleep (1)





        • Task 3: Create a user password program that will check a user's user name and password and give them access if they are correct or tell them that they have one of them wrong. If they get the user name and password correct, show Mr Marsden's URL http://www.lmarsden.com

        • Hint




        Practical Tutorial: Python - Pre-test Loop - While Structure

        • Task 04: Create a digital lock for your locker. Ask the user for the combination and tell them if they have access or no aceess. They are to keep entering answers until they get it correct. Also count the number of times it takes to get the correct guess.

        • Hint:




          correct_lock_number = "1234"
          user_input = "null"

          count = 0

          while correct_lock_number != user_input:
          user_input = str(input("Enter the lock Number? "))

          count += 1





        • Advanced snippet




      • Extension Work:
      • Explore word art / ASCII art to improve the UI (User Interface) and UX (User eXperience).



    Readings / Homework

 

 

 

 

Focus Point

 

 

Information