Welcome to Data 8: Foundations of Data Science! Each week you will complete an assignment like this one. You can't learn technical subjects without hands-on practice, so these assignments are an important part of the course.
Here we will introduce how to turn in assignments.
Collaborating on assingments is more than okay -- it's encouraged! You should rarely remain stuck for more than a few minutes on questions, so ask a neighbor or an instructor for help. (Explaining things is beneficial, too -- the best way to solidify your knowledge of a subject is to explain it.) Please don't just share answers, though.
In today's worksheet, you'll learn how to:
This webpage is called a Jupyter notebook. A notebook is a place to write programs and view their results, and also to write text. Text cells (like this one) can be edited by double-clicking on them. They're written in a simple format called Markdown to add formatting and section headings. You don't need to learn Markdown, but you might want to.
After you edit a text cell, click the "run cell" button at the top that looks like ▶| or hold down shift
+ return
to confirm any changes. (Try not to delete the instructions of the lab.)
Some cells contain code in the Python 3 language. Other cells contain code written in markup. We will learn the difference in Lab 1. For now answer the following questions.
Question 1. What is your name?
Respond to this, by replacing the ellipses (...) inside the quotation marks below with your name.
########
## Replace the ellipses (...), with your name.
########
name = "..."
Change the cell below by setting the variable year to 1,2,3, or 4 so as to complete the following question. Then hold down shift
+ return
.
Question 2. I am a ----- this year. 1. freshman 2. sophmore 3. junior 4. senior 5. dual enrollment student
############
# Change the variable year that is listed below!
############
year =...
############
# Do not alter the code below. It can break!
############
year1=['freshman','sophmore','junior','senior','dual enrollment student']
if -1< year <5:
print('This year is my', year1[year-1],'year!')
elif year == 5:
print('I am a dual enrollment student!')
else:
print('I am not sure.....')
Let's try another question. Change the cell below by filling in the string. Then hold down shift
+ return
.
Question 3. What is your major?
Respond by replacing the ellipses below with your major.
############
# fill in the string below with your major
############
major = '...'
############
# Do not alter the code below.
############
print('My major is',major,'!')
Question 4. Rate how extroverted you are on a scale between 0-10, where ten is extremely extroverted while zero is completely introverted.
############
# Type a number below
############
extraversion_factor = ...
############
# Do not alter the code below.
############
def extraversion(extraversion_factor):
if -1< extraversion_factor <2:
return('I consider myself introverted!')
elif 2<= extraversion_factor <5:
return('I consider myself somewhat introverted!')
elif 5<= extraversion_factor <8:
return('I consider myself somewhat extroverted!')
elif 8<= extraversion_factor <11:
return('I consider myself extroverted!')
else:
return('I am not sure how extroverted I am.')
extraversion(extraversion_factor)
Question 5. On average how many people do you text a week? 1. between 0 and 5 people 2. between 6 and 10 people 3. between 10 and 20 people 4. more than 20 people
############
# Change the variable textees that is listed below!
############
textees = ...
############
# Do not alter the code below. It can break!
############
if 0<textees<5:
answerss=['between 0 and 5 people','between 6 and 10 people','between 10 and 20 people','more than 20 people']
print('You indicated you text',answerss[textees-1],'a week!')
else:
print("Something's wrong, try again. Remember, it has to be between 1, 2, 3 or 4.")
Just run the cell below to see the introduction made from your answers to the questions above.
## Just run this cell. Don't edit it in any way.
print(f" Hello, my name is {name}, I'm currently a", year1[year-1], f"at UNG majoring in {major}.\n",
extraversion(extraversion_factor), f"I estimate that I text", answerss[textees-1], "per week.")
You can use Jupyter notebooks for your own projects or documents. For now lets save and download this notebook. First choose Save and Checkpoint from the File menu.
Now download this notebook as an html and a ipynb. Then rename them as yourlastname_firstnameintialletter_firstday.html and yourlastname_firstnameintialletter_firstday.ipynb. For example if your name was Jacob Jinglemeyersmith the file names would be Jinglemeyersmith_J_firstday.html and Jinglemeyersmith_J_firstday.ipynb.
Then click on First Day Assignment on D2l and click on Add a file. Please submit both versions of this assignment.
You're done with this worksheet!