Lab 1

.pdf

School

New York University *

*We aren’t endorsed by this school

Course

1114

Subject

Computer Science

Date

Dec 6, 2023

Type

pdf

Pages

4

Uploaded by ChancellorDolphinMaster963

Report
CS-UY 1113 - Lab 1 January 27th, 2023 You will need Python 3 installed on your laptop for this lab. Ideally, you would be using Idle or Thonny as a development environment, which would include Python. If you need help with this, please connect to a teaching assistant or instructor ASAP! All lab work must be submitted to Gradescope before you leave the lab. You must try each problem at least once. It is your responsibility to remember to submit your work. Gradescope is odd in that when you submit one file, all previous submissions (are deleted). So be sure that your final submission includes all solution files. Problem 1 1. Start Thonny on your computer. 2. Select “New” from the “File” menu to create a new Python file. This will open a new, empty file editing window. 3. Name the file lab1_p1.py and save it somewhere where you can find it later. Note that the file has a .py suffix. The lab assistants will instruct you how to submit this file to Gradescope when you are finished. 4. We want the file to contain basic information about the assignment: your name, your course, the date, the name of the assignment. However, we want Python to ignore this information, as it isn’t code and it’s useful only for a human being reading your file (e.g. for your professor or TA). Such text to be ignored is called a comment. Write a comment at the top of the file like this, but replace "Pat McStudent" with your name (both first and last name) # Pat McStudent # CS - UY 1113 # 27 January 2023 # Lab 1 Notice that each line above begins with a pound-sign (#) to indicate that it is a comment. Alternatively, you can write a comment like this: """ Pat McStudent CS - UY 1113 27 January 2023 Lab 1 """ 1
Notice that the comment begins with three quotation marks in a row ( """ ) and continues until the next three quotation marks in a row. Both of the above two syntaxes (using # or using """ ) are equivalent. Text that is not part of a comment will be processed normally by Python and must obey the usual rules of Python syntax. In the future, all submitted code for labs should begin with such a comment header. Note that you may lose points in a problem if your solution file does not include the comment header. 5. Below the header, in this file, enter the following statement which will print a nice greeting. Be sure to provide your name in the part where it says "<your name>" , but replace the <your name> with your name (leaving the double quotes). print("Hello Professor DePasquale, my name is", "<your name>") print() print("In this class, I understand that I...") print("* can work on labs with another student,") print("* must work on all other graded work without outside help, and") print("that if I am caught ", end="") print("in violation of the Student Code") print("of Conduct, I will be subject to disciplinary action.") 6. Finally, before you upload to Gradescope, test the program by running it. Be sure that the output your program produces is as shown below (including capitalization, spacing and the comma!), but of course with your given and family name present. Hello Professor DePasquale, my name is <your name> In this class, I understand that I... * can work on labs with another student, * must work on homework without outside help, and that if I am caught in violation of the Student Code of Conduct, I will be subject to disciplinary action. 2
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help