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...

  • 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.

  • 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...

  • 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:

  • P 6.1 page 373, Write a program to initialize a list with 10 random integers from...

    P 6.1 page 373, Write a program to initialize a list with 10 random integers from 0 to 1000(inclusive) and output the following: (10 points) import random SEED = int(input("Input seed: ")) random.seed(SEED) print("\na. Every element at an even index") print("\nb. Every even element") print("\nc. All elements in reverse order.") print("\nd. Only the first and the last element.")

  • C Program Question: Write a program that reads all integers that are in the range of...

    C Program Question: Write a program that reads all integers that are in the range of 0 to 100, inclusive from an input file named: a.txt and counts how many occurrences of each are in the file. After all input has been processed, display all the values with the number of occurrences that were in are in the input file. Note: The program ignores any number less than 0 or greater than 100. Note: Do not display zero if a...

  • in python 3 Create a list or tuple with 5 different integers. Prompt the user for...

    in python 3 Create a list or tuple with 5 different integers. Prompt the user for an integer. If the number is in the list (or tuple) print a message stating the number was found. Otherwise, print a message stating the number was not found. Assume the list includes the numbers 0, 2, 4, 6, 8, and 10.

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