Laura Sach

Laura Sach

Laura creates and maintains Raspberry Pi educational resources. Aside from computers, she loves cats, cakes, board games and making jam.

Location UK

Activity

  • Take a look on your code for checking the third answer. You've got

    answer3 = quiz.answerq3.value;
    if (answer2 == "10") {

    You're checking the value of answer2 not answer3!

  • Hi @MiriTuf - you don't actually need the myClass p styles -you'll find that if you remove those styles the picture sits nicely within the border

  • Hi @BishnuKumarAdhikari - I think the code is working correctly. When you call the various functions to validate, if one is found to be False, the whole condition will be false so the other functions will not even be called. So you'll only get a popup for the first thing that is wrong each time.

  • Hi @BarneyAngus-Southall - what happened when you tried to add the <head> tag? Where did you add it?

  • I hope so too Bev, good luck with your charity endeavours!

  • Hey @MariaJoseBarrenecheaGonzalez glad you had fun! I've had a quick look and there are several reasons for the X's:
    - Some tags you have added more than once, e.g. there are two <head> tags and the page only expects one
    - Inside the <img> tag you have added all of your attributes without spaces between them which is confusing trinket
    - You don't need to...

  • Hi @DimitrisPapakonstantis - that is very cool. You'll need some kind of database or data structure to do this more efficiently, for example you could store your table info in a dictionary and then use the inputs to look up the appropriate information. This is well outside the scope of this course though, you're doing really well! We have some other free...

  • Hi @AworindeDamilola it looks like you haven't uploaded the images to the trinket - if you click on the image icon to the top right of the code area there are none displayed.

  • The following steps in the course explain further what you need to do :)

  • Hi @MalikYakineSoualem - welcome to the course! Please post your comments in English so that other learners can read them and reply :)

  • You'll learn in week 2 that div tags are incredibly useful for changing the layout, colour, position, basically everything about your page, when you style them with CSS :)

  • Hi @MiriTuf - if you follow the instructions above at the end you can publish your page. The <hr> tag will put a line across the page whereas the <br> tag moves onto the next blank line. The reason your links are displayed one underneath each other is because the <h3> tag automatically adds a line break when it ends.

  • Hi @MuhammadAshirIdris - if you look at the images you have uploaded, the names you have used in the code need to be identical to the name of the image. So for example "trinket.jpeg" isn't working because the image you uploaded is called "trinket.jpg" (no 'e')

  • Hi @OscarA - I can't see your site, could you check the link is correct?

  • You're totally right @JasonEvans that _is_ really confusing! I'll report it and get it sorted :)

  • I don't really recommend using inline styles for anything except trying things out - it's much better to use a stylesheet, otherwise when you want to change something you have to find the exact place on the page and change it. If you want to change multiple images (e.g. you've decided all of the images on your page should be 500px wide not 400px) and you've...

  • You're right that if you give two elements the same ID, they will both receive the same styling - just as with a class. HTML is designed to be forgiving and your browser will accept it. BUT...this is invalid HTML, and will cause you problems later on if you want to refer to a particular element using JavaScript, for example, or to add a href to a specific...

  • @DimitrisPapakonstantis You'll need to put the font as "Times New Roman" (including the spaces and quotation marks). This is true for all fonts with multiple word names.

  • Aha, you've discovered the fun of responsive design which is covered in the next step!

  • I don't know if this analogy helps @DimitrisPapakonstantis but imagine the context of a school. The ID is like an ID card - it belongs to exactly one student. The class is like a class of students - the class can contain multiple people and you can refer to them all at once (e.g. "Class 1, go for lunch")

  • If you look at line 2 of the 'script.js' file in the trinket provided (the one containing the rndm_colour function), you'll see that the function itself contains a list of colours - red, green, blue, purple etc. You can add colours to this list and they will be included in the possibilities that can be randomly chosen.

  • You're right @DimitrisPapakonstantis - I just had a quick look at your code, and you can probably notice that each of your functions is pretty much identical except for the element that it shows or hides. It's possible to pass in the name of the element you want to change as an 'argument' to the function - this page might help:...

  • Hi everyone, I'm Laura and I'll be one of your educators on this course. Good luck with your learning and I'll pop in regularly to check how you're getting on! :)

  • Hi @MiriTuf - I can't see the original because it's the same trinket, but I think that your problems with the lists are because you have forgotten to close some of the <li> tags - each item in the list must start with <li> and end with </li> before the next one begins.

  • Hi @YihanZhao - you have misspelled “True” in the while loop near the bottom, which is what the error message is telling you

  • Hello, I’m Laura and I’ll be one of your facilitators on this course. I’ll stop by each day to see whether you have any questions or problems. I hope you enjoy using guizero! :)

  • Hi @SUATTANIR - guizero is a wrapper for tkinter, so in a way, you will indeed be using it! However, the commands used in the course will only work if you have the guizero module installed too.

  • Hooray, glad it got sorted! :)

  • I would have to agree @SebH - love a good f string!

  • Hi @YihanZhao - it looks like you’re missing a space between def and the first _ in the init method name?

  • Hi @SamirHussen - it looks like you’ve got a missing closing bracket at the end there?

  • Hi @ImaadMalik - did you copy the shapes code from the link and save it as shapes.py in the same folder as your code?

  • Hi Carol, have a look at this project - https://projects.raspberrypi.org/en/projects/getting-started-with-git - it should get you started with the basics. If you’re using Windows I would highly recommend downloading the GitHub client for Windows because it makes the process very easy.

  • Ahh! You add the getters and setters (and any other methods) inside the class. So this means they need to be indented and begin somewhere after the line class Room():

  • Hmm, I’m not sure @EmmaGeorge - it sounds like if the text turns black it’s not being recognised as a Python file! Very strange.

  • I am absolutely loving that you’ve provided a changelog of what you have added with your code updates, so helpful! :)

  • Glad it’s sorted Carol. :)

  • Hooray! :D

  • Brill, glad you got it sorted! :)

  • I think your description property needs to be the other way around - you’d return the value of self._description in the property, and then set it using the setter (which is also missing the decorator). But the name one looks spot on!

  • How can I help @Laurence<3~Beven~ - could you explain a little more about what’s confusing you?

  • Thanks @AnkitaNegi this is a really helpful reply. Yes, the best way in Python is to specify parameters with a default value, which makes them optional.

  • Hi @SebH please would you be able to post your full code so we can have a look and help you? That error message means that you’re trying to run the method on a string, rather than an instance of the room object.

  • Sorry @CarolWareing I missed your reply! I tried your code and the problem is that when you state the position of the shape you use set_X (capital X) but the method uses a lowercase x. If you change it to lowercase you’ll get both the blue and yellow rectangles. A really tricky one to spot, but (depending on which code editor you’re using) you should get an…

  • Absolutely right. The get_details() method doesn’t specify a return value, so Python is automatically returning None. So by using the print statement around the call to the method you’re effectively saying please print out whatever this method returns…which is nothing.

  • Hi @PragyaM - you’re clearly thinking along some good lines because this stuff is coming up later in the course!

    1) If you look at week 3 of the course, we make the loop a little more complicated there than just an infinite loop
    2) What you could do is convert the whole input to lowercase, like this:

    command = input("> ").lower()

    This means that…

  • Hmm, sorry about that @MiguelGuerrero - I’ve asked the team to check it out!

  • Looks pretty good to me! :D I think probably the only way you could make it shorter would be to use a list and loop through the list. I had a quick go, something like this:

    ~~~
    nombres = [“Juan”, “Diego”, “Sara”, “Santi”]
    tortugas = [0, 0, 0, 0]

    for movement in range (100):

    corre = [randint(1,5), randint(1,5), randint(1,5),...
    
  • Aha, yes, OOP does come up a lot, so it’s a good thing to understand the principles of :)

  • LAURAence :D :D

  • Hi @CarolWareing , what happens when you try to run the program?

  • Hi @SamirHussen - have you checked whether you used a capital letter when you created the Lauren turtle, or did you write lauren? The case of the letters matters. If that’s not it, perhaps you could post your whole code so we can have a look and help?

  • Hi @SantiagoSánchez - if you want to keep track of the winner, take a look at the part of the code which begins ‘for movement in range(100):’. Inside this loop you generate a random number for each of the turtles each time the loop runs. If you create variables (or indeed a list) to add up the random number generated each time for each turtle, at the end of…

  • Hi Carol. This course does indeed assume you have some existing Python knowledge. If you’re looking for a beginners Python course, have a look at Programming 101 - https://www.futurelearn.com/courses/programming-101

  • Hello and welcome to the course! I’m Laura and I’ll be here each day to see how you’re getting on and help if it’s needed. I work at the Raspberry Pi Foundation but previously I was a secondary classroom teacher of Computer Science. I hope you enjoy the course :)

  • Hi @VictorinoJulio - if this is your first time using Python, may I recommend that you take the Programming 101 course first, because this course assumes you already know some basics of Python? https://www.futurelearn.com/courses/programming-101

  • Hello @14黄帝安.Benedict. I’ve just run your code and it works absolutely fine. The triangle doesn’t draw but you just need to add () after the triangle.draw part to make that happen. I think it’s likely that you haven’t copied the shapes.py file according to the instructions above, or it is not in the same folder? Try that part again perhaps to check?

  • Hi @14黄帝安.Benedict. - please could you share your code so that we can help you? You can paste it into a comment with ~~~ at the start and end to show that it is code, like this:

    print("Hi")
    
  • @KT Yes you can use Thonny as well. Any Python IDE that you like using is fine.

  • Hi @HannahPitts - if this is your first time using Python I would recommend you start with the Programming 101 course instead. This course assumes you already have some Python knowledge. https://www.futurelearn.com/courses/programming-101

  • Interestingly, your two string methods .upper() and .lower() are methods, but len() is odd because it is a built in function rather than a method on a string. You can tell because the first two are used as xxx.upper() whereas len is used as len(xxx) where in both cases xxx is the string.

  • The brackets at the end imply that the things you’ve listed above are methods - i.e. you can call them upon the object and they perform some task and potentially return some information. Attributes do not have brackets because they store a value (or multiple values depending on the data type).

  • Yes that is fine

  • Hi @MichaelDorner - if this is your first time using Python I would recommend you try the Programming 101 course first, as this course assumes you already have some Python knowledge. https://www.futurelearn.com/courses/programming-101

  • This means that Python expected to see the line after the one indicated to be tabbed in. This happens if you’ve put in your ‘for’ loop, but not then indented the lines of code which are supposed to be inside it. If you can post the whole code which causes the error we’ll be able to have a look and help you.

  • Hello and welcome everyone! I’m Laura and I’ll be facilitating this run of the course. I’ll stop by every day to see how you are all getting on and to hopefully answer any questions. Hope you enjoy it! :)

  • Hopefully all of those things are covered in this course! You can use something different than ‘self’ - Python will let you, but it isn’t a good idea because almost every resource and programmer you will find uses self, so you will probably end up confusing yourself!

  • Hi @WilliamTate - welcome. If you’re a complete beginner you might want to start with Programming 101 instead and come back here later, as this course assumes some prior knowledge of Python https://www.futurelearn.com/courses/programming-101

  • @YuWaiLuo Data link layer :)

  • Hi @YuWaiLuo I'll try to answer :)

    Q1 - HTTPS is an application layer protocol
    Q2 - If person A (sender) is sending a message to person B (receiver), they encrypt the message using B's public key which B has published for anyone to see. B already knows their own private key which is used to decrypt the message.

    HTTPS encrypts the data exchanged between...

  • Crikey you have eagle eyes Max! I just did the quiz to check and I didn't even spot it the first time. Yes, they are all supposed to be bytes, I'll get that changed. Thank you for flagging it up.

  • @NyreeScott Have you tried any of our other courses on Python - the Programming 101 course is a great place to start!

  • Hi Aichatou, nice to see you on the course. Please would you be able to comment in English on this course, so that you can chat with the other learners? Many thanks! :)

  • I'm guessing that the answer of 5 comes from looking in the table, seeing 10, moving across and seeing 5 next to it and not looking at the column headings?

  • Hi @MuskanChadda - not sure if you saw my comment below. A kilobit is 1000bps, and a kibibit is 1024bps. So the abbreviation 1kbit/s would refer to 1000 bits per second.

  • Why do you think that might be?

  • What were your thoughts?