Question

Using Python latest version. 4. File Name:  usernameListMe a. In this file, write the code to create...

Using Python latest version.

4. File Name:  usernameListMe

a. In this file, write the code to create a python list of strings that are 4 classes that are offered in the ICT program like "ict463" .  
b. Then create a list of 4 classes that are Gen-ED courses like "math121".
c. Write the code to concatenate the lists into a third variable.  
d. Add a line of code to add one more Gen-ED course to the third - concatenated variable.
e.Add a line of code that removes one of the ICT courses from the third list variable.
f. Add a line of code that prints all three of the variables out on separate lines..

0 0
Add a comment Improve this question Transcribed image text
Answer #1

#a. In this file, write the code to create a python list of
# strings that are 4 classes that are offered in the ICT 
# program like "ict463" . 
list1 = ['ict461', 'ict462', 'ict463', 'ict464']

# b. Then create a list of 4 classes that are Gen-ED 
# courses like "math121".
list2 = ['math121', 'math122', 'math123', 'math124']

# c. Write the code to concatenate the lists into a third variable.  
finalList = list1 + list2

# d. Add a line of code to add one more Gen-ED course 
# to the third - concatenated variable.
finalList.append('math125')

# e.Add a line of code that removes one of the ICT 
# courses from the third list variable.
finalList.remove('math122')

# f. Add a line of code that prints all three of
# the variables out on separate lines..
print(list1, '\n', list2, '\n', finalList)


Please upvote, as i have given the exact answer as asked in question. Still in case of any issues in code, let me know in comments. Thanks!

Add a comment
Know the answer?
Add Answer to:
Using Python latest version. 4. File Name:  usernameListMe a. In this file, write the code to create...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • write a code that includes the following:(PYTHON NOT JAVA) # This program uses the writelines method...

    write a code that includes the following:(PYTHON NOT JAVA) # This program uses the writelines method to save # a list of strings to a file. def main(): # Create a list of strings. # Open a file for writing. # Write the list to the file. # Close the file. # Call the main function.

  • please write in python. thank you In this question you will be writing the code to...

    please write in python. thank you In this question you will be writing the code to carry out a query on a database table in Python. The CREATE command shown below is given just for your reference, so that you know the structure of the table and its columns. The database is an SQLite database in the file named taxa.sqlite. create table species ( id int primary key, genus varchar ( 5 0 ), species varchar(50), common_name char(100) ) Write...

  • Please write the following code as simple as possible in python: You will need to define...

    Please write the following code as simple as possible in python: You will need to define a function with four arguments. Here is what I used: > def find_matches(file1.txt, output1.txt, strings, value): file1.txt will contain a list of various strings. The program must copy from the first argument, and it should be written in the second argument (the second file, "output1.txt"). The third and fourth arguments will determine which specific strings will be copied over to the second file. For...

  • Help me write a python code. Write a program that asks the user for the name...

    Help me write a python code. Write a program that asks the user for the name of a text file, then reads each line of the text file and prints it on the screen, making every other line "title case." For example, suppose the following text is saved in my_file.txt: While I nodded, nearly napping Suddenly there came a tapping As of someone gently rapping, Rapping at my chamber door. When run, the program looks like this: Enter filename: While...

  • PYTHON Im stuck, this is one line of code but I just cant remember it... Please...

    PYTHON Im stuck, this is one line of code but I just cant remember it... Please Help! Thank YOU! LIST COMPREHENSION Create a python list, that stores exactly [0,'hi', 2, thi', 4, thi', 6, 'hi', 8, thi') using python list comprehension. You can write one line of python code directly below (in the text box) or you can upload a python file having only one line of code. Write your solution (one line of python code) here. Enter your answer...

  • USING PYTHON PROGRAMMING LANGUAGE 15. Write code to open a file named data.txt, which contains 3...

    USING PYTHON PROGRAMMING LANGUAGE 15. Write code to open a file named data.txt, which contains 3 numbers, and print the sum of those numbers to the console 16. Write code that opens a file named words.txt containing an essay, and the prints out the SECOND word in the file to the console

  • I need help with this python programming exercise, please! thanks in advance Create a Python script...

    I need help with this python programming exercise, please! thanks in advance Create a Python script file called hw4.py. Add your name at the top as a comment, along with the class name and date. Both exercises should be in this file, with a comment before each of them to mark it. Ex. 1. Write a program that inputs an integer number from the user, then prints a letter "O" in ASCII art using a width of 5 and the...

  • l Question 2 -JS and Python a) Write JavaScript code to create a function called "sortstingsDesc"...

    l Question 2 -JS and Python a) Write JavaScript code to create a function called "sortstingsDesc" that will sort an array of string suppiied as a parameter in descending order. (4) Write Python code to create a function called "addToFront" that will accept two parameters the list of information and the value to be added and place the value to the beginning of the list. [4) b)

  • using python The following shows the result of calling function read_from_file_sum_squares() for each of these two...

    using python The following shows the result of calling function read_from_file_sum_squares() for each of these two files: >>> from praco import read_from_file_sum_squares >>> read_from_file_sum_squares () Enter the filename: file1 9 >>> read_from_file_sum_squares () Enter the filename: file2 14 20 1 >>> You can use file = open(filename, "r") to open the file named by string filename to read, and the line list_lines = file.readlines() to store in list_lines the list of strings, where each string is a line of the...

  • Task 1: Write a Python program that takes as input from the user the name of a file containing po...

    python code: Task 1: Write a Python program that takes as input from the user the name of a file containing postcode/location information. Each line in the file consists of the postcode followed by a tab followed by a comma-separated list of locations that have that postcode. For example, the file Small.txt contains: 3015 Newport,South Kingsville,Spotswood 3016 Williamstown 3018 Altona,Seaholme 3019 3021 Albanvale,Kealba,Kings Park,St Albans Braybrook, Robinson Your program should create a list of postcode/location pairs with each pair stored...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT