Python Forum
Newbie to CS and Python, 2 questions - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Homework (https://python-forum.io/forum-9.html)
+--- Thread: Newbie to CS and Python, 2 questions (/thread-15779.html)



Newbie to CS and Python, 2 questions - johneven - Jan-31-2019

Hello, I'm a newbie to CS and Python (i.e., 2 weeks)and have been doing fairly well so far, but I've been having trouble with the following questions. They seem easy enough, but I'm stuck and can't figure it out.

Question #1
Create a list from 0 through 40 and assign that list to the variable numbers1. Then, accumulate the total of the list’s number values and assign that sum to the variable sum1.

Question #2
Count the number of characters in string1. Try not to use (len). Instead, use a Python function. Then save the number in variable numbers1.
  • 1 string1 = "I like nonsense, it wakes up the brain cells. Fantasy is a necessary ingredient in living."

These are similar to practice questions in a Coursera course.

Thank you in advance for your help. Answers for these would be great so I can see and learn how to tackle such code.


RE: Newbie to CS and Python, 2 questions - j.crater - Jan-31-2019

Hello, we are happy to help, but will not write code for you.
Show your attempt at solving the tasks (in Python code tags) and we will point out what the problems are and guide you to solving the problems.


RE: Newbie to CS and Python, 2 questions - johneven - Feb-01-2019

Hi J.Crater,
I've been perusing my notes throughout the day and found solutions to my above problems. Thanks for your offer of help. I may well need it another day.
Best,
John