Advertisement
Guest User

Untitled

a guest
Jan 28th, 2019
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.06 KB | None | 0 0
  1. trying to create a password and a age limit
  2. check it out if it need correction pls tell me
  3.  
  4. while True:
  5.     name = input('choose a username: ')
  6.     password = input('select a password: ')
  7.     age = input('enter your age: ')
  8.     if int(age) < 12:
  9.         print('hey kiddo you are not eligible')
  10.     else:
  11.         break
  12. def login():
  13.     while True:
  14.         user = input('enter your username: ')
  15.         passw = input('enter your password: ')
  16.         if user != name or passw != password:
  17.             print('your username or password is not correct')
  18.         else:
  19.             break
  20.     try:
  21.         import re
  22.         import urllib.request
  23.         stock = input("search: ")
  24.         url = 'https://www.dictionary.com/browse/' + stock
  25.         data = urllib.request.urlopen(url).read()
  26.         data1 = data.decode("utf-8")
  27.         m = re.search('content=',data1)
  28.         f = re.search('. See more.">', data1)
  29.         star = m.end()
  30.         end = f.start() +1
  31.         new = data1[star:end]
  32.         print(new)
  33.     except:
  34.         print('check your network')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement