+ 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!
3 Réponses
+ 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,
+ 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!
+ 2
@Ipang Thanks a lot. It worked! I'll be sure to add you to my code as deserving some credit!