Skip to content

code review file for Pruthviraj#198

Open
pbutiya wants to merge 3 commits intokscanne:masterfrom
pbutiya:master
Open

code review file for Pruthviraj#198
pbutiya wants to merge 3 commits intokscanne:masterfrom
pbutiya:master

Conversation

@pbutiya
Copy link
Copy Markdown

@pbutiya pbutiya commented Feb 16, 2023

No description provided.

def language_Function():
print("")
print("****************************************************************PLEASE SELECT LANGAUGE **********************************")
print("********* 1."+languageList[0])
Copy link
Copy Markdown

@kishore223 kishore223 Feb 16, 2023

Choose a reason for hiding this comment

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

Instead of using '+' operator, use string formatting.

str = inputString
fLetter = str[:1]
sLetter = str[1:2]
if fLetter== "T" or fLetter== "t" or fLetter== "N" or fLetter== "n":
Copy link
Copy Markdown

@kishore223 kishore223 Feb 16, 2023

Choose a reason for hiding this comment

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

Use 'in' operator to simply code.

exit_Function()


if inputString=="2": # For TURKISH OR AZERBAIJANI
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

It is better to use elif statements, as this will improve the performance of the code.

select_Function()

# Logic for each langauge, In future more langauges can be added and their logic can be written.
def select_Function():
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I don't really like the design of this code — you've mixed the logic for lowercasing with a bunch of user-interface menu code. This is not "modular" is the positive sense we've discussed in class. Could you refactor what you have into a single Python function that takes two strings as arguments (a string to lowercase and a BCP-47 code)? See the homework specification for more details.

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.

3 participants