Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Boogie3335yIt's just a simple exercise for rookies that can be solved with a one-liner. A beginner will probably use a for loop, more advanced programmer can use map.
Also, making a photo of a screen should be illegal as we have screenshots. -
@Boogie I use devrant just on my phone, otherwise I would have. And yes, I am a beginner in python.
-
It takes 30 seconds to upload it to something like Google drive and download it on your phone... js 🤷🏻♂️
-
asgs115635yI'm not sure, but I guess they forgot to tell the user to hit the run button to see the answer
-
Boogie3335y@HarshGaur I don't know python but I can assess how complex is this task. There are some things you have to know before you solve it.
1. Strings. For someone new to programming that can be the first time you deal with this kind of data structure.
2. Arrays. Same with string, another data structure, not all languages differ string and array.
3. For loop. You have to iterate array and modify it in a loop. Also, indexing, off-by-one problem. Every beginner makes simple indexing mistakes.
4. String and array manipulation. You know how to use replace(), lower() and append(). Probably you had to google those.
5. Chaining methods. It's not obvious for someone who is learning his/her first language.
I don't know how python maps look like, but in javascript you can replace for loop with map and the code will look even neater. It can be a first step into functional programming.
It's an OK task. For a rookie it can even be a good excuse to google a couple of things. -
@Boogie Thanks for help, I am following the pattern udacity is teaching and I have learned about things like strings and arrays. I posted this just to show that udacity using names of the characters from the popular tv show "friends". Umm... thanks for the help anyway.
-
It's a simple exercise for newbies. Could just go with this :p
@highlight
usernames = [
n.lower().replace(" ","_")
for n in names
] -
devs30815yIt’s actually a pretty good exercise (for beginners that is). It can be solved in many different ways, and can show off some of the nice features about python
Related Rants
Can it BE MORE INTERESTING?
joke/meme
udacity