#!/usr/bin/env python # coding: utf-8 # # First Day Assignment # # 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. # # #### Today's Worksheet # # In today's worksheet, you'll learn how to: # # 1. save and download jupyter files; # 2. turn in these files to D2L or Gradescope; # 3. compile code blocks; and # 4. assign variables. # # # # 1. Jupyter notebooks # 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](http://daringfireball.net/projects/markdown/syntax) 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.) # ## 2. Cells # 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. # In[ ]: ######## ## 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 # # # In[ ]: ############ # 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. # In[ ]: ############ # fill in the string below with your major ############ major = '...' ############ # Do not alter the code below. ############ print('My major is',major,'!') # #### Let's finish up the questions with the next two. # # **Question 4.** Rate how extroverted you are on a scale between 0-10, where ten is extremely extroverted while zero is completely introverted. # In[ ]: ############ # 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 # In[ ]: ############ # Change the variable textees that is listed below! ############ textees = ... ############ # Do not alter the code below. It can break! ############ if 0