py 1
This commit is contained in:
21
python/1-py-variables/README.md
Normal file
21
python/1-py-variables/README.md
Normal file
@ -0,0 +1,21 @@
|
||||
Python Variables, Lists and Dictionaries
|
||||
========================================
|
||||
|
||||
Create a variable named byte and set it equal to "school".
|
||||
|
||||
Create a [list](http://www.tutorialspoint.com/python/python_lists.htm) named instructors and have it contain the strings "Armen", "Chris", and "Greg"
|
||||
|
||||
Create an [tuple](http://www.tutorialspoint.com/python/python_tuples.htm) named students and have it contain the strings "Adolfo", "Benny", "Billy", "Brendan"
|
||||
|
||||
What's the difference between a list and a tuple? Why use one over the other?
|
||||
|
||||
Create a dictionary with the following key-value pairs- "byteAcademy":byte, "instructors":instructors, "students":students
|
||||
|
||||
Print the keys and values of the dictionary. It should look like this:
|
||||
```
|
||||
byteAcademy - School
|
||||
instructors - Armen, Chris, Greg
|
||||
students - Adolfo, Benny, Billy, Brendan
|
||||
```
|
||||
Look into iterating over dictionaries in Python.
|
||||
Check out [.format](https://infohost.nmt.edu/tcc/help/pubs/python/web/new-str-format.html)
|
0
python/1-py-variables/variables.py
Normal file
0
python/1-py-variables/variables.py
Normal file
Reference in New Issue
Block a user