I need help


I need help to write my very first python program to cover this conversation bellow.
‘What is your name?’
‘Thanks, Josh. What is your favorite color?’
‘Mine is white. Do you like Burger?’
‘Cisse, how old are you?’
‘… and how many brothers and sisters do you have?’’
‘That means you are one of 6 children. Is Blue-Green the favorite color of anyone else in your house?’

Strings and Console Output


I’m trying to understand your question here? Are you just trying to figure out how you would go about writing a program that outputs what you wrote above?


Yes, That’s exactly what I am trying to do.
I thought I understood the process but I don’t get the result expected from the interactive console.


well, to write something to the console, in python you use the print('') statement.

for example, your first line would look something like:

print('What is your name?')

unless you are wanting a user of your program to dynamically interact with this, then you would write something up along the lines of:

user_name = raw_input('Enter your name: ')

raw_input() does basically the same thing as print(), the difference is that with raw_input() you can allow the user to type something themselves!


what code do you have so far? What step are you struggling with and would you like that we explain to you?


Here is the first one I did with different content but similar dialog.

# This program says hello and asks for my name.

print('Hello world!')
print('What is your name?')     # ask for their name
myName = input()
print('It is good to meet you, ' + myName)
print('The length of your name is:')
print('What is your age?')  # ask for their age
myAge = input()
print('You sill be '+ str(int(myAge) + 1) + 'in a year.')


What problems you run into? Given you have a different dialog, we have no idea what it is you want. I see an error, function names are case sensitive so it should be len(), but for the rest, please ask specific questions so we can help you where you need it


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.