כתבתי את הקוד שנראה לי הגיוני אחרי השקעה רבה. השורה האחרונה של הקוד לא עבדה ולא הבנתי מדוע. אחרי שהתייעצתי עם חבר הרצנו ב Online Python Debugger - online editor. זה עבד מצויין. באנקונדה היתה בעיה חוזרת עם השורה האחרונה. מבחינתי פתור לי התרגיל אבל במחברת זה יראה לי error-
username = (input('Please enter your name: '))
password = (input('please enter your password: '))
if ‘wrong’ in username:
print(password)
if ‘ads sports’ in password:
print(“Welcome, Dear client”)
Yam
היי. מה ה־Error שהוצג?
newmedia.video
הי, תודה
File “”, line 6
print("Welcome, Dear client“)
^
SyntaxError: EOL while scanning string literal
newmedia.video
ידיד שלי שעזר ניסה והרגע אמר שבפייתון 3 זה עובד וב 2 לא
Yam
אגיד בזהירות שאני חושב שידיד שלך טועה
יכול להיות שבהעתקה מהדפדפן למחברת כמה מהתווים התחרבשו.
בדוק בבקשה שהמרכאות שלך הן מרכאות תקינות (גם הצ’וקו וגם הצ’וקיים)
newmedia.video
הי, תודה, אני אישה (נועה), אני מבינה למה אתה מתכוון. אנסה
newmedia.video
תיקנתי את אחד מהגרשיים. קיבלתי את הקלטים בסדר אבל אחרי שהכנסתי את הסיסמה קיבלתי את הטעות הבאה
Please enter your name: wrong
please enter your password: ads sports
NameError Traceback (most recent call last)
in
1 username = (input('Please enter your name: '))
2 password = (input('please enter your password: '))
----> 3 if wrong in username:
4 print(password)
5 if ‘ads sports’ in password:
NameError: name ‘wrong’ is not defined
Yam
היי נועה, מתנצל על הבלבול.
עכשיו זה לא עובד כי הסרת את הגרשיים ממקום שבו גרשיים היו נחוצות