Имя 'x' может быть не определен < /p>
< /blockquote>
и < /p>
variable 'x' x 'x' x 'x' x 'x' x 'x' x 'x' x 'x' x 'x' x 'x' x 'x' x 'x' x 'x' x 'x' x 'x' x 'x' x ' />
Quickly about what a program does:
- It can log in the users
- It can sign up a user if there is not a one with this name
- A user can withdraw or deposit money to his account
Код: Выделить всё
users_info = {
'Bill_Cruz': {
'age': 45,
'number': '+248-4052-388',
'card': '5269-5440-9962-2708',
'balance': 4321.54,
'password': 'bill'
},
'Robert_Soup': {
'age': 34,
'number': '+562-5065-778',
'card': '4716-7816-7850-1836',
'balance': 12701,
'password': 'robertsoup123'
},
'Paula_Smith': {
'age': 41,
'number': '+231-7307-367',
'card': '4556-4566-2049-4595',
'balance': 75.65,
'password': 'paulasmith123'
}
}
def name_validation():
global name, name_edited **### line 27**
while True:
name = input('Please give me your name and surname: ').title().strip()
name_edited = name.replace(" ", "_")
if name.lower().strip() == "r":
print('Wellcome to the registration page!')
new_name = input('I`m gonna need your name and surname: ').title().strip()
new_name_edited = new_name.strip().replace(" ", "_")
users_info.update({new_name_edited: {'password': input('Enter a new password: ').strip(),
'balance': 0}})
name = new_name
name_edited = new_name_edited
break
elif name_edited not in users_info.keys():
print('USER NOT FOUND, try again: (r - for signing up)')
continue
else:
break
def log_in():
attempts = 3
while True:
if attempts != 0:
password = input(f'Please enter your password\n(attempts left - {attempts}): ').strip()
if password == users_info[name_edited]['password']:
print('>>>>>>>>>>>>>>>
Подробнее здесь: [url]https://stackoverflow.com/questions/75088189/i-got-warning-as-name-x-can-be-undefined-and-global-variable-x-is-undefi[/url]