Ask coding questions

← Back to all posts
how do i figure out my dogs age
goop0711 (2)

name=(input("what is your dogs name: "))
if name == "Oscar":
print("now we have that info what is your dogs birth year?:")
else:
print("wrong answer try again!")
if number < 2020:
print("that is immposible enter a new number:")
else:
print("so your dog is")

Commentshotnewtop
eldolle (1)

year=(input("now we have that info what is your dogs birth year?:"))
print(2019 - year)

TimothyAnderso1 (65)

Aight so:

year = input('Dogs birth year:')
print('your dogs age is:', year)

using a comma after text, allows you to insert variables into print functions like so:

variable = "Hello!"
print("Test:",variable)

Output:
Test: Hello!

abdulalam (0)

ask him/her using google translate