Sign In
Not register? Register Now!
You are here: HomeOther (Not Listed)Technology
Pages:
3 pages/≈825 words
Sources:
No Sources
Level:
Other
Subject:
Technology
Type:
Other (Not Listed)
Language:
English (U.S.)
Document:
MS Word
Date:
Total cost:
$ 18.23
Topic:

Python Coding, Running Programming Assignment Paper (Other (Not Listed) Sample)

Instructions:

Python running programming

source..
Content:
def getData():
list = []
name_list = []
verb_list = []
fruit_list = []
name_input = input()
verb_input = input()
fruit_input = input()
seperator = ','
namestr = name_input.split(seperator)
verbstr = verb_input.split(seperator)
fruitstr = fruit_input.split(seperator)
name_list.append(namestr)
verb_list.append(verbstr)
fruit_list.append(fruitstr)
list = name_list + verb_list + fruit_list
print(list)
here is the main function that creates the sentence (given in the code for output):
def main():
seed = int(input())
print("The seed is", seed)
names,verbs,fruit = getData()
print("NAMES:", names)
print("VERBS:", verbs)
print("FRUIT:", fruit)
random.seed(seed)
for i in range(10):
n = pick(names, random.randint(1,1000))
v = pick(verbs, random.randint(1,1000))
f = pick(fruit, random.randint(1,1000))
print(n,v,"the",f)
if __name__ == "__main__":
main()
Code.
NAMES = ['Adam', 'Betty', 'Charlie', 'Debbie', 'Elaine', 'Frank' 'George','Harry', 'Igor', 'Jack', 'Kevin', 'Larry', 'Moe', 'Nancy', 'Ophelia', 'Phil', 'Quentin']
VERBS = ['had', 'found', 'got...
Get the Whole Paper!
Not exactly what you need?
Do you need a custom essay? Order right now:

Other Topics:

  • Kohler Cimarron Toilet Reviews Research Assignment
    Description: Comfort Height; feature offers chair-height seating that makes sitting down and standing up easier for most adults....
    3 pages/≈825 words| 1 Source | Other | Technology | Other (Not Listed) |
  • Writing Programming Codes and Code Compilation Errors
    Description: The following code causes some compilation errors. Find them and correct them. Answers #include class A { public: A() { std::cout << "constructing object of class A" << std::endl; } ~A() { std::cout << "destroying object of class A" << std::endl; } void setDatum(int i) { theDatum = i; } int getDatum(void) {...
    5 pages/≈1375 words| No Sources | Other | Technology | Other (Not Listed) |
  • Programming: Finding Errors in Codes
    Description: Q1. The following code causes some compilation errors. Find them and correct them. Answers #include class A { public: A() { std::cout << "constructing object of class A" << std::endl; } ~A() { std::cout << "destroying object of class A" << std::endl; } void setDatum(int i) { theDatum = i; } int...
    5 pages/≈1375 words| No Sources | Other | Technology | Other (Not Listed) |
Need a Custom Essay Written?
First time 15% Discount!