Objectives:
• To get familiar with the functions in Python
Data:
• None
Steps:
1. Log into the AWS console, and start your environment in Cloud9.
2. In the terminal, update your local repository by typing:
git pull
3. Create a new python script, name it lab8.py, and try to answer the following questions.
3.1. Define a function to count the number of words in a string.
3.2. Test your 3.1 function with the demo_str = 'hello world!'
3.3. Define a function to find out the minimal number in a list with a for loop.
3.4. Test your 3.3 function with the demo_list = [1,2,3,4,5,6]
3.5. Test your 3.3 function with the mix_list = [1,2,3,4,’a’,5,6]. If your function generates errors, redesign the function in 3.3
4. Upload the new python file to GitHub by typing the following command in the terminal:
git add --all
git commit -m "some notes here."
git push
5. Go to your GitHub repository and check the changes.
In questa pagina del sito puoi guardare il video online Lab 8 Function in della durata di ore minuti seconda in buona qualità , che l'utente ha caricato LBSocial 31 dicembre 2020, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 404 volte e gli è piaciuto 2 spettatori. Buona visione!