Disneyland for procrastinators and lazy people.
This project is ideal to are avoiding someone annoying, it takes no more than 20 lines of code, and it can save you for the rest of your life!
We wanted a project that used very little Python but still with a very fun application, the excuse generator takes 20 lines of code, is super simple to understand and is the perfect first-ish project for any beginner developer.
Please create a python script that generates an excuse each time it is runned.
How can we generate an excuse? How are sentences built?
The idea is to generate each part of the sentence randomly to come up with great excuses!
Do not clone this repository because we are going to be using a different template.
We recommend opening the python boilerplate
, using a provisioning tool like Codespaces (recommended) or Gitpod. Alternatively, you can clone the GitHub repository on your local computer using the git clone
command.
This is the repository you need to open or clone:
$ git clone https://github.com/4GeeksAcademy/python-hello
Then, Run the app by typing on the terminal:
$ python3 main.py
💡 Important: Remember to create a new repository, update the remote (git remote set-url origin <your new url>
), and upload the code to your new repository using add
, commit
, and push
.
- Create an
app.py
file with one excuse hard-coded in one variable. - The excuse must be in a variable:
excuse = 'The dog eat my homework when I finished'
- Using python, create a function that generates and returns a random excuse with the following structure:
who = ['the dog','my granma','his turtle','my bird']
what = ['eat','pissed','crushed','broked']
when = ['before the class','right in time','when I finished','during my lunch','while I was praying']
- To create a consistent excuse, you have to concatenate one item from each array in the proper order.
- Print the excuse on the console using the
print
function.
Python.
This exercise covers the following fundamentals:
- Running python files.
- How to work with Lists (arrays).
- Generating random numbers.
- Concatenating strings.
- Using functions (at least a bit).