+ 1

How to make my code register 2 digit numbers as a string input?

Here is a sample of my code. It only seems to register 1 digit numbers, sadly. Could anyone help me correct this? sign=str(input()) if sign.count("1"): print("Capricorns are strategists. They like to plan & rehearse everything in advance. They tend to be highly practical people who like structure, organization, tradition, and stability.") elif sign.count("12"): print("Pisces people are selfless, they are always willing to help others without hoping to get anything back.") #Thanks, guys!

5th Aug 2017, 11:14 AM
Dean Carter
Dean Carter - avatar
3 Answers
+ 4
Convert input to integer sign=int(input("Month of birth:")) use if statement to decide which zodiac is selected, based on <sign> value. Hth,
5th Aug 2017, 1:48 PM
+ 5
@Dean Carter, glad to help, it's not necessary at all, I'm here only to help, when and where I can. Who knows maybe one of these days you help me. That's what community is after all. Cheers!
5th Aug 2017, 3:03 PM
+ 2
@Ipang Thanks a lot. It worked! I'll be sure to add you to my code as deserving some credit!
5th Aug 2017, 2:02 PM
Dean Carter
Dean Carter - avatar