/python_ex_1

python refresher exercises - part 1

Primary LanguagePython

Python refresher exercises
part 1 
May 25, 2020

- This set of exercises uses topics from refreshers 1 and 2: basic data types and flow control
- But, you're free to use other python concepts (functions, OOP) as well
- My solution is directly below, but with a visual buffer so you don't see it accidentally.

You should have gotten this file by forking the python_ex_1 project from my github
repo: https://github.com/ChHarding/python_ex_1

How to work the exercises:
- Use a debugger to set a break point at the print() at the top of the solution part so you
 don't accidentally run beyond it and see the solution. This is the "end" breakpoint
- Set another "start" breakpoint at the print() that shows the start of each part
 write you code between those break points
- To run your code, start the debugger (will stop at the "start" breakpoint) and
 hit step or continue. Once you have your bug free solution, remove the start and
 end breakpoints and move on to the next part. Here's an example:


# part 0
# This is just a simple example to demonstrate how the start and end
# breakpoint system works
# Task: get the user's name with input() and print out Hello <name>
# print("start of part 0") set breakpoint here
# your code here


print("end of 0") set breakpoint here 
'''























# solution 1
name = input("What's your name?")
print("Hello", name)
'''

Before we really start, a couple more things:
- your solution may be different or even better than what I showed
- Please get in the habit of documenting your code as you go along!
  You don't need to state the obvious but you should point out anything 
  that could be interesting later.
- After you've finished the code for a part (or even more often) you must
  perform a commit! You should also push your commit to the remote master (Push)
  once in a while

Grading:
- I will grade purely on effort based on your comments and commits!
- Each part is worth 1 point
- That means I don't really grade (judge you) by the quality of your code
- Please give it your best shot and try to get a good result but it's up to you
  you fancy you want to get. If you're stuck, you can't get a good result,
  and you're out of time, just put in a (brief) comment about what you tried
  and move on. If a part always produces an error (i.e. would stop execution)
  use ''' ''' to comment out the entire part, that way your debugger won't stop!
  I will still give you your point if I can see that you at least tried ... something!

Handing in:
- once you're done type this into your OS console in VS:
python refresher_ex_1.py > results.txt
this will run your file and put the output into results.txt.
on Canvas hand in:
- your version of this .py file
- your results.txt
- tell me the URL of your forked repo 

May 29, 2020
- I just added a folder called one ex per file, which has each exercise (1 through 4) as a separate file.
- Use this if you don't like working with one very long .py file
- If you do use it, just give me 4 results file (results1.txt, results2.txt, etc.)