prayforthewicked
Badges: 6
Rep:
?
#1
Report Thread starter 2 years ago
#1
I am very stuck on this question for homework and any help would be appreciated. I am not very good with Python and flowcharts either...

Name:  homework ewww.jpg
Views: 96
Size:  21.6 KB

Sorry if you can't see it very well!
Also if anyone has any tips for learning Python, any help would be nice as I'm not looking forward to my on screen NEA on Python!

Thank you (the homework is due in next Tuesday)
0
reply
Clutch A
Badges: 9
Rep:
?
#2
Report 2 years ago
#2
(Original post by prayforthewicked)
I am very stuck on this question for homework and any help would be appreciated. I am not very good with Python and flowcharts either...

Name:  homework ewww.jpg
Views: 96
Size:  21.6 KB

Sorry if you can't see it very well!
Also if anyone has any tips for learning Python, any help would be nice as I'm not looking forward to my on screen NEA on Python!

Thank you (the homework is due in next Tuesday)
Can't provide help if I can't see it. If you're talking about the question highlighted in green, I'm gonna need you to type it out please. Task 2 is correct though. As for tips to learn Python consider: YouTube guides, w3schools, codeacademy (even though i don't personally recommend this option) and etc. The best way to learn programming in my opinion (which is how I also personally learnt multiple languages with) is to learn different programming concepts and apply them in a single project. So for example let's say I just learnt how to declare a variable, take input, use if statements, print to the screen and even change the value of a variable. You can easily create a project to apply all of these concepts. An example would be an application that takes input and stores it into a variable. Then then proceeds to evaluate that value with an if statement, and if the value is let's say greater than 18 it will multiply the value stored in the variable by 3 and print it out to the screen. You've easily applied 5 fundamental programming concepts in one easy and short project in an effective and productive manner. You need to be hands on when programming, it's the only way you'll remember and apply different concepts in a language (the same way real life languages work). As soon as you've learnt something new - program it!
0
reply
winterscoming
Badges: 19
Rep:
?
#3
Report 2 years ago
#3
(Original post by prayforthewicked)
Also if anyone has any tips for learning Python, any help would be nice as I'm not looking forward to my on screen NEA on Python!
On learning python - it's more about learning the mindset where you can 'think like a programmer' -- that's the hard part really; it's not so much about the language syntax - memorising the syntax may be a bit strange to start with, but most people get used to it fairly quickly. There's also a lot of terminology to learn, which may also be tricky at first. You can cement most of that in your mind by following through Codecademy. With that said, getting used to the syntax and understanding the terminology is worth spending time doing.

Beyond that, it's really about problem solving and computational thinking - but the only way you can really learn that mindset is practice -- sitting down and using the python language to solve problems - start out with things which are small and simple until you're comfortable with the fundamentals and then build on top of those with more complex problems. Once you're a bit more comfortable with syntax/terminology, look back through any exercises or assignments that you might have missed and try those. If you run out, try some of these practice exercises which ramp up in difficulty: https://www.hackerrank.com/domains/python

Remember that there are really only 3 different things that a computer can actually do:
  • Execute one or more (block of) instructions in Sequence
  • Selection of different (blocks of) instructions to run depending on a true/false condition
  • Repetition of the same (block of) instructions more than once.

These are the 3 building-blocks of any program or algorithm (Sequence, Selection, Repetition). -- Actually those are the 3 different things that you would express in a Flowchart too, except using boxes and lines instead of a programming language.

A computer will only do exactly what you tell it to do. Computational thinking is all about learning to express what you want a computer to do in terms of those 3 building blocks, while also thinking about the variables ("stuff in memory") which store data/information used by or changed by those instructions.

One of the "hard" things is remembering how your variables change when you've got some long code which is doing lots of things (Hint: the way to crack this problem is to learn about how to split your program down into nice small. easy pieces...)

There's some great lectures/lessons on Py4E - https://www.py4e.com/ -- if you follow these, make sure you also tackle the assignments and problem sets because that's where the learning really happens.

Some other videos here on Python: https://www.youtube.com/watch?v=nwjA...LjhgGiSeVlIRwt

Useful PDF for when you run into a Python error or problem in your code: https://pythonforbiologists.com/29-c...s-on-one-page/

There's a decent free e-book for Python here: http://greenteapress.com/wp/think-python-2e/

Python's official documentation / tutorial has loads of information and short examples, although it's very terse and not very beginner-friendly:
https://docs.python.org/3/tutorial/

If you have some code where you want to visualise exactly what's happening, try pasting it into this visualiser and letting this show you everything step-by-step:
http://www.pythontutor.com/visualize.html#mode=edit
0
reply
X

Quick Reply

Attached files
Write a reply...
Reply
new posts
Back
to top
Latest
My Feed

See more of what you like on
The Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

Personalise

Feeling behind at school/college? What is the best thing your teachers could to help you catch up?

Extra compulsory independent learning activities (eg, homework tasks) (5)
4.31%
Run extra compulsory lessons or workshops (19)
16.38%
Focus on making the normal lesson time with them as high quality as possible (21)
18.1%
Focus on making the normal learning resources as high quality/accessible as possible (15)
12.93%
Provide extra optional activities, lessons and/or workshops (35)
30.17%
Assess students, decide who needs extra support and focus on these students (21)
18.1%

Watched Threads

View All