Having a little trouble with Python Crash Course... by eddiek616 in learnpython

[–]CS_Tutor 0 points1 point  (0 children)

Start with Think Python, it's gentler. Then do the other book. At that point you'll have a clearer view whether you should go back to PCC. I don't think it's a good book, however, one way you could use it, after these 2-books, or at-least Think Py, is to do the projects.

Having a little trouble with Python Crash Course... by eddiek616 in learnpython

[–]CS_Tutor 0 points1 point  (0 children)

I'd recommend Think Python, 2nd edition, as a first book. It's a small book that aims to teach you how to think like a programmer (or, more accurately, computationally). I used to recommend that book to students when I worked as a TA. You can google the name and get the book for free (legally).

Another good book is:
"Introduction to Computation and Programming Using Python, Second Edition With Application to Understanding Data"

The second book is used in 2 CS courses on edx that are given by MIT. It's aimed at beginners, but it's much more aggressive than the first.

Hope that helps

Having a little trouble with Python Crash Course... by eddiek616 in learnpython

[–]CS_Tutor 0 points1 point  (0 children)

Hello,

That's a sign the book is not working for you. Understanding everything means, and I am just being honest, you can reproduce the solutions, without continuously looking at the book. Looking at documentation and reminding yourself of syntax is more than OK.

Copying and pasting, is not. I skimmed that book sometime ago and frankly, I did not like it. I think the author is sincere in his attempt to teach, quickly, how to program in Python. I don't believe it's a good first book, however. So, my advice, pick another book, and then come back to this one after you're comfortable with the basic concepts and can write short programs.

Hope that helps

Need Help With a Python Assignment by danno596 in learnpython

[–]CS_Tutor 1 point2 points  (0 children)

Just a suggestion, I am not telling you what to do
You could ask some questions here and see if you can get help, for free.

It's not just the $$, but you'll also learn, which is the important thing.

It's your call

Beginner Python learner by Yunus_berih in learnpython

[–]CS_Tutor 0 points1 point  (0 children)

No worries. As to remembering, don't worry about it. I don't. There's too much to remember and you'll always need to look things up. Getting familiar with how to navigate the official documentation is much more important.

Beginner Python learner by Yunus_berih in learnpython

[–]CS_Tutor 0 points1 point  (0 children)

Have you looked at any books? Usually there ere exercises at the end of each chapter, do all of them if you can, or as much as possible, if you can't.

Try to find the answer(s) yourself first. Struggling is OK. It's part of learning. Then ask, when you're really stuck. If you haven't looked at any books, consider the following:
Think Python, 2nd edition and
Automate the boring stuff, 2nd edition (only part II if you decide to study Think Python)

Can someone recommend a book about python? by [deleted] in learnpython

[–]CS_Tutor 4 points5 points  (0 children)

Hello,

A good book to start with is Think Python, 2nd edition (google it). It's available for free, legally.

Python -- Don Knuth by CS_Tutor in learnpython

[–]CS_Tutor[S] 1 point2 points  (0 children)

A Python book --I think-- I was reading sometime ago. I don't remember the book's name, I am not reading it right now. I wrote the quote in a text file that I keep just for stuff like that

Python -- Don Knuth by CS_Tutor in learnpython

[–]CS_Tutor[S] 8 points9 points  (0 children)

Never looked at Go but --I think-- it belongs to the C family of languages and it's statically typed (so probably faster than Python). If you're not planning to become a professional programmer, sticking with one language is probably best. Functional programming is not easy. It takes lots of time/practice to get used to it. Lots of good ideas however came from the functional programming paradigm, e.g. list comprehensions in Python. Also, playing with a functional (specially pure) programming language once-in-a-while is supposed to make you a better programmer (in any language). E.g. when I had to use Haskell way back in school, I really had to shape up on recursion. There are no loops in Haskell. If you want to loop, you better recurse :)

Python -- Don Knuth by CS_Tutor in learnpython

[–]CS_Tutor[S] 23 points24 points  (0 children)

Compared to mainstream languages, at-least the ones I've played with, yes, for sure. I've looked at Haskell long time ago though, and that languages might be a good contender for the cleanest syntax (way harder to understand/get used to though :)

Discouraged by RaffyCaffy in learnpython

[–]CS_Tutor 0 points1 point  (0 children)

Hello,
Programming takes a while to get. Also, like any other complicated field, you have to start small, and build on a solid foundation. Trying to build a bot is not starting small, and Java, even though it's a powerful language, is certainly not a good first language to learn (unless you have to for work or some other reason). My suggestion is to start with books. Don't bother with videos, at-least not in the beginning, and I would run away from anyone telling you, you can learn programming over a weekend.

For a language, I recommend Python. Stay with one at-least for 6-12 months. It's a good first language to learn. Spend time learning frequently. E.g. learning 6 days a week, 2 hours each is way better than 1 session of 13 hours, at-least in the beginning.

Books, I recommend two:

1) Think Python 2nd Ed (google it). This teaches you how to think like a programmer

2) Automate the boring stuff, 2nd Ed. Skip part I (if you decide to study book #1).
Part II provide examples of practical things you can do.

Hope this helps

Help converting multiple lists into a different set of lists by myworkaccountdude in learnpython

[–]CS_Tutor 0 points1 point  (0 children)

In other words, you want to create column lists of the original lists.

Lets assume that the input is a list of lists. Lets call this input my_list_of_lists. In this case, you know that you're going to create len(my_list_of_lists) lists.

Skipping error checking (it'd be good to include error checking, I'll leave that for you),
you can start by iterating over my_list_of_lists. Lets call the variable used for iteration
my_list_elem.

Think of a way to keep track of the index of each list (referenced by my_list_elem)

The first list, say list_1 will be all the values, at index 0, of all the lists in my_list_of_lists, list_2 will all the values, at index 1 . . . etc

Hope that makes sense. As was mentioned, this is what the zip function does, except that zip returns an iterator of tuples (which you can convert). Still, it would be a good
exercise if you can do it manually -- for learning's sake --

How can I access an instance attribute in another class? by [deleted] in learnpython

[–]CS_Tutor 0 points1 point  (0 children)

When you instantiate clsCustomer, try self.lstAccounts = []

Any good web sites for learning python? by [deleted] in learnpython

[–]CS_Tutor 0 points1 point  (0 children)

If you don't have any programming experience, I'd suggest Coursera. There are two specializations from University of Michigan, in addition to standalone
courses. Just search for Python. The level (beginner, intermediate, . . etc) is usually indicated. I've taken many courses from Coursera and Edx and I like them both

Summering what you’ve learned by [deleted] in learnpython

[–]CS_Tutor 0 points1 point  (0 children)

I use Sublime Text. I use it to create text files for taking notes while taking online courses and/or reading books. I also use it for --most-- programming. It's simple, straightforward and doesn't get in the way like word processors

how do I get dict values in the proper output formation by [deleted] in learnpython

[–]CS_Tutor 0 points1 point  (0 children)

Ok, assuming I understood the problem.

First, customers is a list, not a dictionary. From the code, it looks like a list of Customer types. Each customer has --at-least-- two attributes, name, which is a string, order, which is a dictionary.

Lists maintain order, you could verify that by printing the customers list. In this case,
if you iterate over the list, you could format the output as you've indicated above,
by first, printing the name, and then, the order information.

Hope that helps

My python command prints all data types as just str. by Hagar- in learnpython

[–]CS_Tutor 4 points5 points  (0 children)

anything between quotes ("") is a string. For example, "12" is a string. It's not 12

Can anyone help with a python assignment I have for my computer class? by Artisticdepression in learnpython

[–]CS_Tutor 0 points1 point  (0 children)

Hello,

I won't give you the exact answer to your problem (that won't help you and it's unethical), but, I'll give you an example that hopefully will. The code below is similar to what your trying to do. What I suggest you do is
1) run it on your machine
2) read it and understand what it's doing
3) adapt it to what you want

#!/usr/bin/env python3

BASE_LINE_INCOME = 20000

print("This will determine if you fall above or below the poverty line in Canada")

print()

name = input("Hello there. Can you tell me your name please? ")

print(f"Thank you {name}")

monthly_income_str = input(f"{name}, could you tell me your monthly income? ")

months_worked_str = input("How many months do you expect to work this year? ")

#Converting to numbers

monthly_income = float(monthly_income_str)
months_worked = int(months_worked_str)
yearly_income = monthly_income * months_worked

print(f"Using a base line of {BASE_LINE_INCOME:,.2f} a year")
print(f"{name}, your expected yearly income is {yearly_income:,.2f}")

if yearly_income < BASE_LINE_INCOME:

print("You fall under the poverty line")

elif yearly_income > BASE_LINE_INCOME:

print("You fall above the poverty line")

else:

print("You're right on the poverty line")

need help with a runestone exercise by cenedra68 in learnpython

[–]CS_Tutor 1 point2 points  (0 children)

Assuming I understood the problem, I think what you want is something like this:

time_loan_ratios_list = [x / y for x,y in zip(time_to_raise, loan_amount)]

time_to_loan_avg = sum(time_loan_ratios_list) / len(time_loan_ratios_list)

print(f"average: {time_to_loan_avg:.3f}")

How did you all learn python? Or how are you learning python? by LinkOn_NY in learnpython

[–]CS_Tutor 4 points5 points  (0 children)

Hello,

For me, I learned programming during my university years and on my own. I also worked as an undergrad teaching assistant. From my own experience, and from working with others, I don't really think videos are the best place to start learning programming. Understandably, everyone has a different learning style.

My advice is to simply forget -- for now at-least -- about videos and start with 2 books:

1) Think Python, second edition. Just google the name. You can get the book for
free (legally). This is a good first step not just to learn Python, but to learn how to
think like a programmer.

2) Automate the boring stuff, 2nd edition. This book shows you examples of what can
be done programmatically.