Advertisement
Guest User

Untitled

a guest
Nov 13th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1.  
  2. def magazine_serial_check(string):
  3. issn_number = string
  4. is_it = False
  5. len_of_it = False
  6. index_number = 3
  7. if issn_number.__contains__("-"):
  8. is_it = True
  9. issn_number = issn_number.replace("-", "")
  10. if len(issn_number) == 8:
  11. len_of_it = True
  12. if is_it == True & len_of_it == True:
  13. return print("ISSN-sarjanumero on oikeassa muodossa")
  14. if is_it == False or len_of_it == False:
  15. return print("Ei ole oikeassa muodossa")
  16.  
  17.  
  18. issn = input("Anna lehden ISSN-sarjanumero: \n")
  19. check_issn = magazine_serial_check(issn)
  20. print(check_issn)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement