-
Notifications
You must be signed in to change notification settings - Fork 0
develop branch #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing work!
@@ -0,0 +1,13 @@ | |||
|
|||
class Person: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
something went wrong here :D
elif entrance.lower() == 'no': | ||
print('Thank you, see you next time...') | ||
else: | ||
input('Your request is not recognised') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you need to give an option or command for user to re enter yes or finish
"Tinta": 8, | ||
"Erol": 6, | ||
"Orhan": 5 | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice use of dict
|
||
|
||
def add_student(name,grade): | ||
if name in students: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you may need to add some string manipulation, capital case or lower case
print('We already have a student with this name') | ||
return | ||
|
||
if grade not in [1-10]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is tricky, remember all input from user get registered as "String", so you need to cast it here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also [] is list in python (similar to Array ) so you have here one item with value -9.
If you want to check range
you can write
grade not in range(1,11)
try: | ||
students[name] = int(grade) | ||
print(f"{name} is added with grade {students.get(name)}") | ||
except ValueError: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
usually it good to add a general exception JIC
print('Please type a number as a level') | ||
|
||
def update (name, grade): | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra line is not a good idea in python :) things can get off records quickly here with no ()
|
||
def update (name, grade): | ||
|
||
if grade not in [1 - 10]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
input need casting
'finish': finish | ||
} | ||
|
||
while order: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Impressive work on while one!
No description provided.