[Tutor] Python user input and return

Alan Gauld alan.gauld at yahoo.co.uk
Mon Sep 6 04:04:46 EDT 2021


On 06/09/2021 00:46, chandar pass wrote:
> After a little research and playing around I was able to get my desired
> output
> 
> ######Jits project######
> 
> 
> User_input = input("What is your favorite Jits move? :")
> print("{} is a sweet submission!".format(User_input))
> User_input2 = input("What is your second favorite Jits move? :")
> print("{} is also a sweet submission!".format(User_input2))
> 
> print ("Now hit the mats and rip those submissions!!")

I'm glad you got it working.
Just a couple of small points. You don't need the second
User_input variable, you could just have reused the first
one.  You'd only need a second if you were storing both
values for later processing.

Secondly, its standard programmer style to use lowercase
names for variables. Capitalized names tend to be for type
definitions or classes - things you probably haven't covered
yet. Python doesn't care but as your programs get bigger
these little style things help give you clues about what's
happening in your code. It's good to develop good habits early.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Tutor mailing list