User Input Challenges - Python

Last edited: 24th June 2022

Fahrenheit to Celsius Converter

Can you write a short program that asks a user for a Fahrenheit temperature and converts it to Celsius for them?

The following code will help you:

celsius=5*(farhenheit-32)/9

Morning or Afternoon?

Write a program that checks the time and greets a user with either 'Good Morning' or 'Good Afternoon'. The following code will help:

import datetime

now=datetime.datetime.now()

comparisontime=now.replace(hour=12, minute=0, second=0, microsecond=0)


This lesson is part of the Simple Python Challenges Course

Agree
We use cookies to provide you with a better service. Continue browsing if you are happy with this.