[go: up one dir, main page]

Skip to content

Assignment from week 1 of Meta's Programming in Python course.

Notifications You must be signed in to change notification settings

AndrewB50/type_casting_input

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

type_casting_input

Assignment from week 1 of Meta's Programming in Python course.

Below is the README file provided by Meta.



Lab Instructions: Type Casting Input

In this lab you will be presented with three exercises to demonstrate how explicit type casting can be.
used to solve data being inputted from an end user. Each exercise will ask you to solve a particular problem relating to types.

Tips: Before you Begin

To view your code and instructions side-by-side, select the following in your VSCode toolbar:

  • View -> Editor Layout -> Two Columns
  • To view this file in Preview mode, right click on this README.md file and Open Preview
  • Select your code file in the code tree, which will open it up in a new VSCode tab.
  • Drag your assessment code files over to the second column.
  • Great work! You can now see instructions and code at the same time.
  • Questions about using VSCode? Please see our support resources here.

To run your Python code

  • Select your Python file in the Visual Studio Code file tree
  • You can right click the file and select "Run Python File in Terminal" or run the file using the smaller
    play button in the upper right-hand corner of VSCode.
    (Select "Run Python File in Terminal" in the provided button dropdown)
  • Alternatively, you can follow lab instructions which use python3 commands to run your code in terminal.

There are two exercises and objectives of this activity:

  • Exercise 1: Use explicit casting to apply the correct cast type

  • Exercise 2: Fix the script so it correctly outputs the bill total

Exercise 1:

In this exercise, you'll use explicit casting to apply the correct cast type.

Instructions

  1. Open the script exercise1.py present inside the project folder

  2. To run the script, open terminal and execute the following command:

    python3 exercise1.py
    
  3. Step 3: Fix the script so the variables have the correct type.

Exercise 2:

Your goal of this exercise is to fix the script so that each variable has the correct type.

Instructions

  1. Open the script exercise2.py present inside the project folder

  2. To run the script, open terminal and execute the following command. You will be prompted to enter some values.

    python3 exercise2.py 
    
  3. Fix the script so it outputs the correct bill total based on the data being entered.


Final Step: Let's submit your code!

Nice work! To complete this assessment:

  • Save your file through File -> Save
  • Select "Submit Assignment" in your Lab toolbar.

Your code will be autograded and return feedback shortly on the "Grades" tab.
You can also see your score in your Programming Assignment "My Submission" tab.

About

Assignment from week 1 of Meta's Programming in Python course.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages