---
title: "Discussion on \"Programming Assignment: Homework 1b - Practice Writing Python & Calculating How Old Your Dog is in Human Years\" | Hashnode"
description: "Discussion on \"Programming Assignment: Homework 1b - Practice Writing Python & Calculating How Old Your Dog is in Human Years\". import traceback\n\ndef calculator():\n\n    # Get dog age\n    age = input(\"Input dog years: \")\n\n    try:\n        # Cast to float\n        d_age = float(age)\n\n        # If user enters negative number, print message\n        # Otherwise, calculate dog's age..."
url: "https://hashnode.com/posts/programming-assignment-homework-1b-practice-writing-python-calculating-how-old-your-dog-is-in-human-years/6470a349df9fefc3309b2168"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Programming Assignment: Homework 1b - Practice Writing Python & Calculating How Old Your Dog is in Human Years](https://abhinavtej.hashnode.dev/programming-assignment-homework-1b-practice-writing-python-calculating-how-old-your-dog-is-in-human-years?utm_source=hashnode&utm_medium=feed)

import traceback def calculator(): # Get dog age age = input("Input dog years: ") try: # Cast to float d\_age = float(age) # If user enters negative number, print message # Otherwise, calculate dog's age...

May 26, 2023 · 1 min read · abhinavtej.hashnode.dev  
Read the article

-   [#coursera](https://hashnode.com/tag/coursera)
-   [#python](https://hashnode.com/tag/python)

## Written by

[Abhinavtej Reddy](https://hashnode.com/@Abhinavtej)

@Abhinavtej · Andhra Pradesh, India

  
[View profile](https://hashnode.com/@Abhinavtej)

## Responses

Markdown supported · ⌘↵ to post

[Ayesha Iftikhar](https://hashnode.com/@ayesha128)

[Mar 16, 2025](https://hashnode.com/posts/programming-assignment-homework-1b-practice-writing-python-calculating-how-old-your-dog-is-in-human-years/6470a349df9fefc3309b2168/comment/67d726fa9455aedb355bc9e8)

good
