icon picker
Project 1: Python

Intro

Python is a programming language that lets you work more quickly and integrate your systems more effectively.

Setup

Copy/paste this text into the left side of the screen and click “Run”:
# set a temperature value
degrees_fahrenheit_str = "72"

# convert text entry to number value that can be used in equations
degrees_fahrenheit_num = int(degrees_fahrenheit_str)

# convert temperature from F to Celsius
degrees_celsius_num = (degrees_fahrenheit_num - 32) * 5 / 9

print ("Temperature in Fahrenheit is : " + str(degrees_fahrenheit_num))
print ("Temperature in Celsius is : " + str(degrees_celsius_num))

# check for temperature below freezing..
if degrees_celsius_num < 0:
print ("Pack long underwear!")

# check for it being a hot day
if degrees_fahrenheit_num > 100:
print ("Remember to hydrate!")

Your Turn

Make the following changes:
Change the messages to have different advice for extreme temperatures.
Change the initial temperatures (hot or cold) to something different.
Set someone’s name in a variable and add this to the output messages.

More Info

To learn more about Python visit:

Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.