Question

Declare a list of 10 integers in the range [0, 99], and then print out all...

Declare a list of 10 integers in the range [0, 99], and then print out all the elements that are greater than 50.

for Jupyter notebook, python

0 0
Add a comment Improve this question Transcribed image text
Answer #1
# Declare a list of 10 integers in the range [0, 99],
numbers = [29, 97, 87, 34, 57, 59, 12, 9, 99, 55]
print("list of numbers is", numbers)

# and then print out all the elements that are greater than 50.
print("Numbers in list that are greater than 50 are", end=' ')
for num in numbers:
    if num > 50:
        print(num, end=' ')
print()
Add a comment
Know the answer?
Add Answer to:
Declare a list of 10 integers in the range [0, 99], and then print out all...
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 program that reads a list of integers in the range (0 – 49) and prints out the numbers that does not repeat twice

    IN PYTHONWrite a program that reads a list of integers in the range (0 – 49) and prints out the numbers that does not repeat twice.The first input of the program is the number of integers contained in this list, followed by the integers contained in the list. Print the numbers in in ascending order.Case 1:INPUT: 5 2 2 3 3 1OUTPUT:1Case 2:INPUT:6 1 2 1 2 2 2OUTPUT:2Case 3:INPUT:4 3 2 1 2OUTPUT: 1 3343 2 1 213

  • #PYTHON In this exercise your function will receive three parameters, a list of integers, and two...

    #PYTHON In this exercise your function will receive three parameters, a list of integers, and two integers. It will add up all values in the list that are inside of the range of the two integers. Parameters: nums, a , b Return Value: A total found by adding all values in nums which are greater than a and less than b.

  • (a) Write a C program to print a list of all integers between 1 and 1,000...

    (a) Write a C program to print a list of all integers between 1 and 1,000 (inclusive) which are divisible by 7 but not by 13. The list should be printed to a file called "output.dat". Remember to close the file after use. (35%) (b) Explain what is meant by the C preprocessor. Explain the effect of the following line of code: #define SQUARE (x) (x) * (x) (25%) (c) Explain the concept of an array in C. Write down...

  • write a Python function that takes in a list of integers and returns maximum and minimum values in the list as a tuple

    1 write a Python function that takes in a list of integers and returns maximum and minimum values in the list as a tuple. Hint (can be done in one pass, you are not allowed to use built-on min and max functions.)max, min = find_max_min(my_list):2 write a Python function that takes in a list of integers (elements), and an integer number (num). The functions should count and return number of integers in elements greater than, less than, and equal to...

  • 1. Create List 2. Create Random integers 3. Search List Write a program that gets random...

    1. Create List 2. Create Random integers 3. Search List Write a program that gets random integers and populates a list, then searches the list 1. Write a program that creates an empty list 2. Populate the list with 100 random integers 3. After creating the list, print the length of elements in the list 4. Select a range of numbers as 10 – 20 5. Find out the number of times ‘15’ appears in the list and print it...

  • Write a python program that stores a random number from 0-99 in a variable named target...

    Write a python program that stores a random number from 0-99 in a variable named target (this part is provided). Note that target will not be further updated in the program. The program then accepts user input and stores it in a variable named guess. You may assume that the user only enters integers. The program ends when guess is equal to target otherwise the program continuously asks the user to provide a guess. Output Correct after x trial! when...

  • Create an array size 10 and fill it with integers from 1 to 10. Print out...

    Create an array size 10 and fill it with integers from 1 to 10. Print out the values. Then, create a pointer that points to the beginning of the array. Finally, print out all the values through a pointer and the memory address where the value is. With C

  • python Make another code block that creates a list using range( ) with 8 values starting...

    python Make another code block that creates a list using range( ) with 8 values starting with 1. print out your list Create a set from each of the three lists. Find the elements in common between the three sets.

  • 47. (2 points) What will the following code print? my-list-on"n) for n in range( 5) İf(n.nr%2--ol...

    47. (2 points) What will the following code print? my-list-on"n) for n in range( 5) İf(n.nr%2--ol print(my_list) Answer Assume that the variable data refers to the list [5, 3, 7). Write the value of the following expressions for questions 48-49. 48. (1 points) datal-11 Answer: 49. (1 points) 0 in data Answer: 50. (4 points) Given my_dict my_dict l'a:3, x':7, r':5, write Python code to print all the key and value pairs of Answer:

  • Having trouble with python! Write a program to build a list of grades, print them out,...

    Having trouble with python! Write a program to build a list of grades, print them out, add to them and count occurrences, and find the amount of the 2-digit grade values. Here are the criteria a) Your program “L6QI initials.py" must start with a commented ID Box AND include a comment that indicates the e of the program. EACH of the five functions in your program must state its purpose in comments too The main function in your program must...

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