Question

on.ca i.cmd med to u nunaown C eSA COwPA 20 or 2. Write a function that takes a single list of characters as argument and ret
0 0
Add a comment Improve this question Transcribed image text
Answer #1
def ascii_upper(lst):
    result = []
    for ch in lst:
        if 'A' <= ch <= 'Z':
            result = [ord(ch)] + result
    return result


print(ascii_upper(['H', 'e', 'l', 'L', 'o', 'W', 'o', 'r', 'l', 'D']))

[68, 87, 76, 72] Process finished with exit code 0

Add a comment
Know the answer?
Add Answer to:
on.ca i.cmd med to u nunaown C eSA COwPA 20 or 2. Write a function that...
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
  • Python Question? Write a function called reverse(user_list, num = -1) that takes a list and a...

    Python Question? Write a function called reverse(user_list, num = -1) that takes a list and a number as parameters. The function returns a copy of the list with the first number of items reversed. Conditions: The number parameter must be a default argument. -      If the default argument for number is given in the function call, only the first number of items are reversed. -      If the default argument for number is not provided in the function call, then the...

  • In problem 3, you will write a function, findvertically (), which will determine whether or not...

    In problem 3, you will write a function, findvertically (), which will determine whether or not a given word exists in a word search puzzle vertically. In word search puzzles, words can be written upwards or downwards. For example, "BEAK" appears at [1] [3] written downwards, while "BET" appears at [2] [2] written upwards: [["C", "A", "T", "X", "R"], ["D", "T", "E", "B", "L"], ["A" "R" "B", "E", "Z"], ["X", "O", "E", "A", "U"], ["J", "S", "O", "K", "W"]] Your...

  • all the answers must be done please help and codes should be done in matlab Part C (Based off week 12 workshop...

    all the answers must be done please help and codes should be done in matlab Part C (Based off week 12 workshop content Sinee the implementation of the CityCyele scheme in October 2010, the Bris bane council has recorded the mamber of City Cycle trips every month The results are available in the CityCycleData.cov' fie on Blackboard 1. Import the data into MATLAB using the cavread fuaction, and the visualise the data with the scatter function Coenment on whether a...

  • 1) Come up with a single (one) question or problem 2) Think of an example with 30 data points a. ...

    1) Come up with a single (one) question or problem 2) Think of an example with 30 data points a. This data needs to be of a quantitative variable (numbers). 3) Then proceed to follow the below steps. example of 30 quantitative data points Purpose State how, when, and where data was collected List of raw data pairs Frequency distribution (table) Histogram Relative percentage polygon Sample mean Sample median Sample mode(s) Sample range Sample variance Sample standard deviation Coefficient of...

  • Develop a Java application that uses a type of encrypted alphabet, called a random monoalphabetic cipher,...

    Develop a Java application that uses a type of encrypted alphabet, called a random monoalphabetic cipher, to encrypt and decrypt a message. Your encryption key and message are to be read in from two different files and then the encrypted message will be output to third file. Then the encrypted message is read in and decrypted to a fourth file. A monoalphabetic cipher starts with an encryption word, removes the redundant letters from the word, and assigns what’s left to...

  • 6. Suppose r0-0x8000, and the memory layout is as follows: Address Data 0x8007 0x8006 0x8005 0x8004...

    6. Suppose r0-0x8000, and the memory layout is as follows: Address Data 0x8007 0x8006 0x8005 0x8004 0x8003 0x8002 0x8001 0x8000 0x79 0xCD 0xA3 0xFD 0xOD 0xEB 0x2C 0x1A Suppose the system is set as little endian. What are the values of rl and r0 if the instructions are executed separately? (a) LDR (b) LDR (c) LDR (d) LDR rl, r1, r1, r1, [re] [r0, #41 [r0], #4 [r0, #41 ! r1 - r1 - r0 - Appendix 1: ASCII Table...

  • Help C++ Write a string class. To avoid conflicts with other similarly named classes, we will...

    Help C++ Write a string class. To avoid conflicts with other similarly named classes, we will call our version MyString. This object is designed to make working with sequences of characters a little more convenient and less error-prone than handling raw c-strings, (although it will be implemented as a c-string behind the scenes). The MyString class will handle constructing strings, reading/printing, and accessing characters. In addition, the MyString object will have the ability to make a full deep-copy of itself...

  • C++ help Format any numerical decimal values with 2 digits after the decimal point. Problem descr...

    C++ help Format any numerical decimal values with 2 digits after the decimal point. Problem description Write the following functions as prototyped below. Do not alter the function signatures. /// Returns a copy of the string with its first character capitalized and the rest lowercased. /// @example capitalize("hELLO wORLD") returns "Hello world" std::string capitalize(const std::string& str); /// Returns a copy of the string centered in a string of length 'width'. /// Padding is done using the specified 'fillchar' (default is...

  • For this assignment, you will write a program to work with Huffman encoding. Huffman code is...

    For this assignment, you will write a program to work with Huffman encoding. Huffman code is an optimal prefix code, which means no code is the prefix of another code. Most of the code is included. You will need to extend the code to complete three additional methods. In particular, code to actually build the Huffman tree is provided. It uses a data file containing the frequency of occurrence of characters. You will write the following three methods in the...

  • so i have my c++ code and ive been working on this for hours but i...

    so i have my c++ code and ive been working on this for hours but i cant get it to run im not allowed to use arrays. im not sure how to fix it thank you for the help our job is to write a menu driven program that can convert to display Morse Code ere is the menu the program should display Menu Alphabet Initials N-Numbers - Punctuations S = User Sentence Q- Quit Enter command the user chooses...

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