Bottom Page

Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Printing one thing from a list
#1
I'm trying to see if I can make something in Python that can make a sentence. The only way I can think to do this is by making the process go, "If I choose an 'I', than after that I should put (insert multiple things that would make sense to go after 'I' here)". Problem is I'm a noob at Python knowing next to nothing about how to use it. The most I could do is assign values and make it print out a math equation. I'm wondering if I can make it go like this:

print([One item from list A] [Item from list corresponding to the word from list A] [Item corresponding to that list]...) ect ect until a sentence is made.

Pry not the best way to do this but I thought it'd be a nice project.
Quote
#2
I would do it like MadLibs. A sentence with blanks in it, each blank having a part of speech (noun, verb, adjective). Then you have a list of nouns, a list of verbs, and a list of adjectives. Use random.choice to pick random words of the right parts of speech to fill in the blanks in the sentence.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures

Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Printing lists acooper7 1 130 Jun-17-2019, 09:37 PM
Last Post: Yoriz
  Printing List in one line bharat_s579 6 258 May-26-2019, 08:30 PM
Last Post: perfringo
  list is printing incorrectly.. anna 1 142 May-18-2019, 12:12 PM
Last Post: ichabod801
  Help with list thing please Yeyzon 1 171 Apr-19-2019, 07:51 AM
Last Post: snippsat
  no outcome is printing helpme 2 193 Mar-07-2019, 02:15 PM
Last Post: helpme
  Printing Easter date occurrences samsonite 8 380 Mar-06-2019, 11:49 AM
Last Post: samsonite
  dict printing last key,value out of loop anna 6 361 Feb-23-2019, 03:22 AM
Last Post: anna
  tuple printing trouble anna 0 201 Feb-09-2019, 05:24 PM
Last Post: anna
  printing maxd = sr.iloc[:1, 1:2] gehrenfeld 3 245 Feb-04-2019, 12:28 PM
Last Post: gehrenfeld
  Printing arguments in python console. Narendra 1 233 Jan-28-2019, 12:00 AM
Last Post: Larz60+

Forum Jump:


Users browsing this thread: 1 Guest(s)