Chapter 01 - Poject 01.pdf - Chapter 01 Python Basics Objective This lab will cover commands and scripting skills learned in Chapter 01 Python Basics

Chapter 01 - Poject 01.pdf - Chapter 01 Python Basics...

This preview shows page 1 out of 1 page.

Unformatted text preview: Chapter 01: Python Basics Objective: This lab will cover commands and scripting skills learned in Chapter 01: Python Basics. This will give students practice in the IDLE, Notepad++, Text Wrangler, gedit, or other text editor to develop simple Python programs. This will expose students to logical thinking methods when creating programs. Directions: Complete the script requirements using the basic commands learned in Chapter 01. Example: Create a script which will take a str( ) value and pass it to a concatenated sentence. Example output: I am 20 years old. #!/bin/env python str(20) print(‘I am ‘ + str(20) + ‘ years old.’) OUTPUT: I am 20 years old. Script 01: Write a simple program that meets the following requirements: • Gives a greeting • Asks who you are (what your name is) and allows for input from user • Greets the new user and introduces yourself • Gives the length of their name • Asks what the user’s age is and gives them their next year’s age • Ends conversation and exits with Goodbye Script 02: Write a simple program that meets the following requirements: • Asks what the value of Pi is to the 10th decimal location. (3.1415926535) • Give your response as a float( ), int( ), and str( ) value. (*The int will not contain a decimal number unless you use something to help it output correctly!) *Make sure you put something like; The float value is… The int value is… The str value is… Script 03: Write a simple program that meets the following requirements: • Asks you what year you were born and then calculates your age from the current year and outputs your age. • Calculates the year you would reach 100 years of age and outputs it to the screen. The scripts should output a semi-­‐narrative format for asking questions and giving responses. For example: If you were to ask someone’s age the output should look like this: How old will you be this year? ...
View Full Document

  • Fall '17
  • Jillian Huekel

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Ask Expert Tutors You can ask You can ask ( soon) You can ask (will expire )
Answers in as fast as 15 minutes