Skip to content

develop branch#1

Open
OBakir90 wants to merge 1 commit into
masterfrom
develop
Open

develop branch#1
OBakir90 wants to merge 1 commit into
masterfrom
develop

Conversation

@OBakir90
Copy link
Copy Markdown
Owner

No description provided.

Copy link
Copy Markdown
Collaborator

@Ashaghel Ashaghel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing work!

Comment thread worksheet.py
@@ -0,0 +1,13 @@

class Person:
Copy link
Copy Markdown
Collaborator

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

Comment thread app.py
elif entrance.lower() == 'no':
print('Thank you, see you next time...')
else:
input('Your request is not recognised')
Copy link
Copy Markdown
Collaborator

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

Comment thread app.py
"Tinta": 8,
"Erol": 6,
"Orhan": 5
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice use of dict

Comment thread app.py


def add_student(name,grade):
if name in students:
Copy link
Copy Markdown
Collaborator

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

Comment thread app.py
print('We already have a student with this name')
return

if grade not in [1-10]:
Copy link
Copy Markdown
Collaborator

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

Copy link
Copy Markdown
Collaborator

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)

Comment thread app.py
try:
students[name] = int(grade)
print(f"{name} is added with grade {students.get(name)}")
except ValueError:
Copy link
Copy Markdown
Collaborator

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

Comment thread app.py
print('Please type a number as a level')

def update (name, grade):

Copy link
Copy Markdown
Collaborator

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 ()

Comment thread app.py

def update (name, grade):

if grade not in [1 - 10]:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

input need casting

Comment thread app.py
'finish': finish
}

while order:
Copy link
Copy Markdown
Collaborator

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants