Python exercises in the browser from Data Camp



#use the variables below to print out "Hello Laura"
name = "Laura"
greeting = "Hello"

print out "Hello Laura"

name = "Laura"
greeting = "Hello"


print(greeting +" "+name)


test_function("print")
success_msg("Good stuff!")


Put variables into a print function

https://github.com/datacamp/datacamp-light-wordpress



#print the numbers 0 to 19

print the numbers 0 to 19

for i in range(10):
print(i)


for i in range(20):
print(i)


success_msg("Good stuff!")


Change the 10 to 20

Basic Project: Building an Office Desktop Mini PC

Basic Project
Building an Office Desktop Mini PC (40 marks)

 

The Project Brief
Your task is to build a mini Desktop PC for use in
an office.
The PC is to be used for tasks like word processing letters, accessing databases and editing spreadsheets so it does not require any of
its components to be particularly powerful.

You have been given a budget of £500 to purchase the following hardware and software.

  •  a mini desktop case
  • Ÿ all the necessary components to fit inside the case
  • Ÿ a 15” flat screen monitor
  • Ÿ a keyboard and mouse
  • Ÿ stereo speakers
  • Ÿ an operating system
  • Ÿ applications software (word processor, spreadsheet and database)
  • The Report

    Your task is to search for all the required hardware and software and write up a
    report on your choices.
    Your report should include the following pages:
    1. A cover page which includes a title, your name and your class.
    2. An index page listing all the hardware and software you are going to
    purchase.
    3. A page for each of your purchases. Each page should include a heading, a
    picture, the price and a brief description of each purchase.
    4. A page listing the price of each device and a total for your purchases.
    5. A bibliography listing the websites you used during the project.

  • Teaching_Notes_for_Building_a_Computer
Published
Categorised as Computing

Heads Tails Heads – probability problem

Problem:

  1. Write a problem to simulate the tossing of a sequence of successive coin tosses.
  1. Search the suitably generated sequence to find a particular pattern, e.g., HTH. Report where this sequence was found – after how many flips in the generated sequence. Allow the user to enter the pattern to look for via the UI (User Interface).
  1. Modify your program to repeat steps 1 and 2 a variable number of times; allow the user to specify this value in the UI. Each repeat should use the same search pattern, but a new sequence of source coin tosses.
  1. Modify your program to keep track of where the pattern was found in each generated sequence. Report the overall average number of coin tosses required to the find the search pattern across all of the repeats.
  1. If your program is correct, you will find that the average number of tosses necessary to find the search pattern HTH is 10, however, HTT it is 8. Why is this (this is another conditional probability problem)?