• Congratulations to the Class of 2024 on your results!
    Let us know how you went here
    Got a question about your uni preferences? Ask us here

python questions (1 Viewer)

_kuroo

Sped
Joined
Mar 1, 2012
Messages
107
Location
Strathfield, Sydney, Australia, Australia
Gender
Male
HSC
2013
I got 3 questions im stuck on. the teacher's given us this handouts and in it...it shows us the syntax BUT NO EXAMPLES. FML

8. Write a program that gets a sentence from the user and display it back with one word per line.
10. Without using the method centre, get a string from the user and a field size then display the string centred within that field, with dots "." on either side. You may assume that the field size is larger than the length of the string.
11. Write a program to get a line of sentence from a user. Your program must count the number of capital letters in the line and disply the number of capital letters.

anyone help?

using python 2.7
 

ismeta

Member
Joined
Feb 19, 2012
Messages
258
Gender
Female
HSC
2012
Wow, this is a really late reply and so will probably be useless but in the case that anyone else has the same issues...

http://codepad.org/V6s8SLj2

(disclaimer - I haven't tested the code, I don't have access to an interpreter/'nix machine at the moment.)
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top