오늘 역대급으로 공부안하고 있어ㅠㅠ 재미를 붙이기 위해 같이 푸는 시간을 가져보도록 하자!
뉴비랑 같이 문제 풀이 하고 놀아주면 취업했을때 보담해줌... (ㅋ..)
힌트 (리스트 단원)
12. Write a program that gets a string from the user containing a potential telephone number. The program should print Valid if it decides the phone number is a real phone number, and Invalid otherwise. A phone number is considered valid as long as it is written in the form abc-def-hijk or 1-abc-def-hijk. The dashes must be included, the phone number should contain only numbers and dashes, and the number of digits in each group must be correct. Test your program with the output shown below.
Enter a phone number: 1-301-447-5820
Valid
Enter a phone number: 301-447-5820
Valid
Enter a phone number: 301-4477-5820
Invalid
Enter a phone number: 3X1-447-5820
Invalid
Enter a phone number: 3014475820
Invalid
재밌네 난 풀었음 너도 화이팅
regex 짜라는 소리자너
코드를 올려주시오!