Python: Beginning problems

Posted by Blogger on Stack Overflow See other posts from Stack Overflow or by Blogger
Published on 2010-04-21T09:45:18Z Indexed on 2010/04/21 10:23 UTC
Read the original article Hit count: 303

Filed under:
|
|

ok so basically i very new to programming and have no idea how to go about these problems help if you will ^^

  1. Numerologists claim to be able to determine a person’s character traits based on the “numeric value” of a name. The value of a name is determined by summing up the values of the letters of the name, where ‘a’ is 1, ‘b’ is 2, ‘c’ is 3 etc., up to ‘z’ being 26. For example, the name “Zelle” would have the value 26 + 5 + 12 + 12 + 5 = 60 (which happens to be a very suspicious number, by the way). Write a program that calculates the numeric value of a single name provided as input.

  2. Word count. A common utility on Unix/Linux systems is a small program called “wc”. This program counts the number of lines, words (strings of characters separated by blanks, tabs, or new lines), and characters in a file. Write your own version of this program. The program should accept a file name as input and then print three numbers showing the count of lines, words, and characters in the file.

© Stack Overflow or respective owner

Related posts about python

Related posts about beginner