PygLatin too difficult


#1

i was doing the excercises and i dont think pyglatin uses the stuff ive learned to make this im at step 2 and i only know what ive done so far and that isnt something ive done

if u understand what im saying can u explain what im missing


#2

Cannot say what you are missing, but your post is missing a code sample for us to review. Please post what you have so far, and we'll try to guide you along.


#3

i dont know how to make sure a user entered a word i dont think we were taught that in the lessons


#4

is there like a wiki i can go to for user submitted stuff or something like i dont know what to write


#5

One way to test the input is to query the length of the returned value. That will at least tell us whether they entered anything or not.

if len(original) > 0

The length of an empty string is 0. More than zero means there is something in the input string.

Python has a built-in method for testing alphabetical inputs. string.isalpha()

Combining these two tests pretty much covers our needs.


#6

At this level, pretty much everything we need to write is in the instructions, including the above two methods. Read the instructions carefully and follow them in order, step by step.


#7

in your code what is that original for? does that check the length of the original code sent by user or something?


#8

The instructions ask us to use the variable original and to store user input in it.

original = raw_input("Enter a word to translate: ")

#9

ahh i think thats what i needed, i think i got it now i will report back afterwards EDIT: yes i get it now, thank you.


#10

When we're we introduced to isalpha in the previous lessons?

Is there a way I should've known to use len() to query the word length?

I have no coding experience. It feels like there has been quite a jump from what I've learnt so far, to being able to come up with this code.

I'm finding the basic concepts in this challenge quite difficult.


#11

If len() was not covered before, it is explained here, in Lesson 4:

Next we need to ensure that the user actually typed something.

empty_string = ""
if len(empty_string) > 0:
    # Run this block.
    # Maybe print something?
else:
    # That string must have been empty.

We can check that the user's string actually has characters!

I'm pretty sure we did not cover string.isalpha() before now, but again, it is explained in Lesson 5:

Now we know we have a non-empty string. Let's be even more thorough.

x = "J123"
x.isalpha()  # False

In the first line, we create a string with letters and numbers.

The second line then runs the function isalpha() which returns False since the string contains non-letter characters.

Let's make sure the word the user enters contains only alphabetical characters. You can use isalpha() to check this!

Bear in mind that this is an introductory course that clips along at a pretty good pace. Very few concepts get covered more than once, or in much detail. As self-learners it is up to us to read the documentation for Python 2.7 and build on what we have started to learn.


#12

Thank you for the reply. That makes me feel a bit better hehe. I was wondering if I'd missed something.

From what you've said I guess the best way to learn is to go through the Python docs and come here to fill in the gaps.

Do you know of any other courses/Python documents that go through a slow, logical process suitable for beginners?


#13

This is a slow approach. I haven't looked for anything slower so can't recommend one. Think of Codecademy as an aptitude test.


#14

Ok thanks! I'll have a look around.


#15

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.