Skip to content

Latest commit

 

History

History
44 lines (33 loc) · 1.66 KB

File metadata and controls

44 lines (33 loc) · 1.66 KB

TRIAL EXAM: Python Basics

Getting Started

  • Fork this repository under your own account
  • Clone the forked repository to your computer
  • Commit your progress frequently and with descriptive commit messages
  • All your answers and solutions should go in this repository

What can I use?

  • You can use any resource online, but please work individually
  • Instead of copy-pasting your answers and solutions, write them in your own words.

Tasks

1-5. Complete the tasks seen in the 1-5.py files! (~90 mins)

Acceptance criteria

The application is accepted if:

  • The solution works according to specification [1p each]
  • The solution follows styleguide [1p]
  • Has proper error handling where the specification says it [1p each]
  • Has the correct loops, methods, filters [1p each]
  • The code is clean, without unnecessary repetition, and with descriptive names [1p each]
  • You commit frequently with descriptive commit messages [1p]

6. Question time! (~30 mins) [6p]

Explain the algorithm used in exercise 2. Use a flowchart, structogram or pseudo code. [2p]

Your answer:

count_a equals 0 Loop through the characters of a filename: if the character equals 'a': increment count_a with 1 when the loop ends return count_a

How can you get a random number in python? [2p]

Your answer:

You can get random number using the 'random' module. The most simple functions are 'randrange' and 'randint'.

What does M stand for in MVC? [2p]

Your answer:

M stands for 'model'. The 'model' manages the data structure, the logic, and the rules of the program.