Question
Do all of this in python no C++ or C language provide both the source code and output for each problem Problem 11 Create an
Do all of this in python no C++ or C language provide both the source code and output for each problem
Problem 11
Create an array of 10 integers and pre-populate it with 10 numbers. Then write a function called printit which will loop through the array and print the values out. Call the function to show it works. Now write another function called finditem and pass it the array and a number to find, call the function which should return a boolean if it's found or not. Test it out on the number 50. If the number fifty is in your array it should print True otherwise false.
Problem 12
Learn how to convert from decimal to binary. Do three examples by hand of the conversion (upload your hand written conversions into your PDF). Now, write a program to convert decimal to binary and test it on the problems you solved by hand to make sure your answers are correct Regardless of the programming language the code to convert digital to binary is only a few lines long and you can find examples of it online very easily. You dont need to worry about negative numbers. Show your three handwritten solutions as well as the source code and output of your program proving it gets the same answers as you did by hand. Please watch this quick video on how to convert by hand:
https://www.youtube.com/watch?v=1TxAm9931TE
Problem 13
Write a program asking the user to keep entering in strings (ie names) until they enter the string leave, at which point youll exit the loop and tell them how many times they entered the string gold. This one requires that you use a loop and also keep a tally of the number of times they enter the string gold.
Problem 14
Implement a function called zeros_and_ones() that takes a list s as argument and returns the number of zeros and ones in a dictionary d.
s = [1,0,1,0,0,1,0,0,1,0,0,1,1,1,1,0,0,0,1,0,1,1,1,1,1]
Hint:
Your program should output {0: 11, 1: 14}
Problem 15
Write a function min_max() that takes a list s as an argument, and print the minimum and maximum values along with their ranks, ie, their
positions (starting at 1) in the input.
Example: my_list = [3, 1, 5, 4, 2] The minimum value is 1 and the rank is 2 in the list The maximum value is 5 and the rank is 3 in.
the list
Question 4
# your code here
my_list = [3, 1, 5, 4, 2]
min_max(my_list)
Hint: your output should look like this
min is 1 rank is 2
max is 5 rank is 3
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started