help with some (basics) questions

This is the place for queries that don't fit in any of the other categories.

help with some (basics) questions

Postby Donovanx » Thu Sep 12, 2013 7:25 pm

Hi folks im back with some more noobish questions!
ok first of the pieceof ode i have so far!

Code: Select all
inp1 = input("must be 26 leters")
ins =  list(inp1)

ins[0] = "a"
ins[1] = "b"
ins[2] = "c"
ins[3] = "d"
ins[4] = "e"
ins[5] = "f"
ins[6] = "g"
ins[7] = "h"
ins[8] = "i"
ins[9] = "j"
ins[10] = "k"
ins[11] = "l"
ins[12] = "m"
ins[13] = "n"
ins[14] = "o"
ins[15] = "p"
ins[16] = "q"
ins[17] = "r"
ins[18] = "s"
ins[19] = "t"
ins[20] = "u"
ins[21] = "v"
ins[22] = "w"
ins[23] = "x"
ins[24] = "y"
ins[25] = "z"

ok now lets start with some questions.
q. = question
q. in the last line of code i have there the print "print(ins[])" now id like to do something like this but i have no idee how print(ins[0 - 25])
ok so i want to print evrything out but i want it in one statement(i think thatsthe right term)
q. then i know how formating for smallthings work and i dont know if it wil be able to do the folowing
i want the results from that print to print the "ins[0] = a" for ex underneath each otherand like "a = ins[0]" but ins[0] must be the 26 leters i type in inp1.

now i know it might be a strange project but youwil getmy intensions in the future its not fancy or anything but it might have its use one day.
and dont just do the code explain it to me (its the only way you learn) oh and if you see some common beginers mestakes like pep formating point it out.
sorry for the spelling and grammer.
and thank you for taking the time to read this!!!
Posts: 13
Joined: Fri May 10, 2013 1:54 pm

Re: help with some (basics) questions

Postby Yoriz » Thu Sep 12, 2013 8:44 pm

Hi im not quite sure if this is what you are trying to do.
Take an input string and print each character on a new line.
Code: Select all
print('\n'.join(list(input("Input letters")))))
Due to the reasons discussed here we will be moving to on October 1 2016
This forum will be locked down and no one will be able to post/edit/create threads, etc. here from thereafter. Please create an account at the new site to continue discussion.
User avatar
Posts: 1672
Joined: Fri Feb 08, 2013 1:35 am
Location: UK

Return to General Coding Help

Who is online

Users browsing this forum: No registered users and 7 guests