שלום,
אשמח לדעת למי מהמתרגלים אפשר לפנות לעזרה.
תודה
שלום,
אשמח לדעת למי מהמתרגלים אפשר לפנות לעזרה.
תודה
היי, ניתן לפרסם פה את בקשת העזרה ואחד המתרגלים יתפנה לסייע.
הי
ביצעתי את תרגיל מערכת בנק במחברת 7 של שבוע שני. הכל עובד תקין למעט דבר אחד:
אם לא הצליחו לבצע לוג-אין עדיין רצה לי שורה של הזן סכום למשיכה.
אשמח לסיוע בנושא. זה הקוד- נראה לי שאין בעיה לפרסם כי ההגשה כבר נסגרה:
customer_name = input('enter your name: ')
customer_password = input('enter your password: ')
def get_password(customer_name):
if len(customer_name) > 0:
x = len(customer_name)
password = customer_name.lower() + customer_name.upper() + (x * ‘x’)
return password
get_password(customer_name)
make_password = get_password(customer_name)
def password_generator():
if get_password(customer_name) == customer_password:
print(‘Login succesfull. How mauch you’d like to withdrow?’)
else:
print(‘Login failed’)
return False
password_generator()
“”"
def did_loged_in():
if password_generator():
amount_asked = int(input('Please enter amount to withdrow: '))
return amount_asked
did_loged_in()
“”"
amount_asked = int(input('Please enter amount to withdrow: '))
def check_amount():
balance = 500 - amount_asked
if amount_asked > 0 and amount_asked <= 500:
print(f"Please take your money {amount_asked} Your balance is: {balance}")
elif amount_asked <= 0:
print(‘Invalid amount’)
else:
print(‘Withdrawal denied’)
check_amount()
מכיוון שהשורה שלך למשיכה לא מוזחת ולא מופיעה באף התניה, ודאי שהיא תרוץ בכ"מ
תודה.
כשהכנסתי לפונקציה זה לא עבד לי.
אפשר לעשות הזחה לקלט אם הוא לא בתוך פונקציה?
כן, נניח אם הוא בתוך if