A Cool Python Mini App
h
JeswinSunsi (30)

Hey!
Here's a small program that I made in Python. The code was inspired from Mike Dane. (He's really good, go check him out too at MikeDane.com) My program allows the user to replace a letter to another specific one in a given sentence..
Please do upvote and check out some of my other cool stuff..
Thenks,
Lona..

You are viewing a single comment. View All
Monitor (3)

It works as intended but I have some comments about your code style (I just mean help so please do not take offence):
1. You have no comments in your code.
2. You have 3 variables defined in global scope.
3. You have code repetition (3 input statements).
4. You do not have a main function.
5. You are using quite nested loop.
6. The following code section can be formatted with less redundant code:

               if letter.isupper():
                    translation = translation + change
               else:
                    translation = translation + change
          else:
               translation = translation + letter```

If you want, you can look at the same program I write differently.

Keep coding!
cheers :) 
Foster_Bryant (97)

@Monitor What is the point of a main function when you can just run the code.

JeswinSunsi (30)

@Monitor
Hey! Thanks for the reply.. Im just a beginner in Python and am learning. I really don't know what global variables are but sure thanks for telling me abt them.
Cheers To You To!

Monitor (3)

@Foster_Bryant Not as it is, but If you want to develop further and may be import this file into some other program, or make small modules part of a big program later etc. then you're gonna realise that you will need it. However, it's a choice of a developer, I think It's a good practice to run the functions inside the main function, some programming language enforce it strictly, Python does not. Still, I think it's a good practice.

JeswinSunsi (30)

@Monitor
Yup totally agree with you. Should def()initely do that next tym.