Zakbets

@Zakbets (0)
Zakbets
Zakbets
shared a Post
3 months ago
1
How do I define my variables
Ask
So I try to define my variables like yearborn and currentyear and the call them later when I subtract the two but it will not call them
Unit 3 Activity Dropbox Padilla
Python
Read full post
CodingElf66
CodingElf66 The if statement has the wrong syntax. For Lines 28-30, do: if monthborn > currentmonth: monthsold = monthborn - currentmonth else: daysold = currentdaystr - dayborn `3 months ago
MrVoo
MrVoo You should use f-strings instead of a bunch of variables and commas, like this: name = 'MrVoo' description = 'spicy' print(f'{name} is {description}!') `3 months ago
Spacecraft
Spacecraft Your input is in the form of a string. In order for your equations to work, you need to convert your input from a string to an integer: yearborn = int(yearborn) currentyear = int(currentyear) or yearborn = int(input("Enter year you were born : ")) currentyear = int(input("\nEnter the current year : ")) This will only work if your variables can be converted to integers. If the input was "three" for example, then it would fail when trying to convert to an integer.3 months ago