Why the (if) doesn't show up? Please help! | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why the (if) doesn't show up? Please help!

I written this code that asks the user to write their ID and contact number, But contact number should be 10 digits. The problem is first print sentence doesn't show up when I write 10 number!!. https://code.sololearn.com/cw4t3wFeGN54/?ref=app

11th Oct 2019, 3:44 PM
RazanAbuawf
RazanAbuawf - avatar
2 Answers
+ 1
Your if statement compares a string to an integer thats why there is an error. What is idPassportNum for i dont see it being used. And if you redefine contactNum to "contactNum" after the input why take in an input for it in the first place? I think you're trying to do this https://code.sololearn.com/cKB2PArnWrTF/?ref=app
11th Oct 2019, 3:47 PM
Odyel
Odyel - avatar
+ 2
get the length then compare them with 10 contactNum.length() == 10
11th Oct 2019, 3:49 PM
Taste
Taste - avatar