Assign avg_owls with the average owls per zoo. Print avg_owls as an integer. Sample output for inputs: 1 2 4 Average owls per zoo: 2 avg_owls = 0.0 num_owls_zooA = int(input()) num_owls_zooB = int(input()) num_owls_zooC = int(input()) ''' Your solution goes here ''' print('Average owls per zoo:', int(avg_owls))
Q: Write a program that reads in a room number, the room's capacity, and the size of the class enrolled…
A: Find the code in python as language not mentioned given as below and output:
Q: Write a program to check if a number is a prime number. 1) let user input a number 2) check if its…
A: Note: Programming language is missing in the question. So we will answer this program in C, and C++…
Q: Write a program (Lab8_ex4_ld.py) that generates a random even positive integer less than 10 and…
A: Generate random number from 1 to 5 and multiply with 2 and then we can print the series
Q: occasion will be here soon. Mr. Chanek needs to enliven his home's divider with decorations. The…
A: Here have to determine about c ++ code for Holiday Wall Ornaments problem statement.
Q: Sites like Zillow get input about house prices from a database and provide nice summaries for…
A: Here I have declared 2 variables and taken input from the user for the values of these 2 variables.…
Q: Write a program with total change amount in pennies as an integer input, and output the change using…
A: Java Code: import java.util.Scanner; public class LabProgram { public static void…
Q: Write a program that takes a date as input and outputs the date's season. The input is a string to…
A: Given: Write a program that takes a date as input and outputs the date's season. The input is a…
Q: Write a program which prints 2 factor of a positive integer. For example, since $24=2^3\cdot 3$, 2…
A: Algorithm:- while(true) { r=n%2; //calculate remainder here if(r==0) //check if…
Q: import random x = random.randint (0,5) if x == 5: print (x, 'Zero') elif x == 4: print (x, 'One')…
A: Introduction of the Program: The random library is used to select random numbers. This library has…
Q: Write a program that takes a date as input and outputs the date's season. The input is a string to…
A: /*C++ program that takes a date as input and outputs the date's season*/ #include…
Q: On a piano, a key has a frequency, say f0. Each higher key (black or white) has a frequency of f0 *…
A: Python code: f=int(input("Enter frequency: "))r=pow(2,1/12) for i in range(4): fn=f*pow(r,i+1)…
Q: Write a program called Fibonacci to display the first 20 Fibonacci numbers F (n), where F (n) =F…
A: PROGRAM CODE: #include<iostream> // include header file for input output…
Q: Write a program that inputs a natural number n from the keyboard, computes the cube sum of first n…
A: Here we would need to use a loop that runs from 1 to n where n is input from user.
Q: Starting 2019, you are going to recruit a new employee for a period of 10 years with a monthly…
A: Note: This code should be rewritten instead of copying to the compiler otherwise it will throw a…
Q: Write a program that reads 11 integers, compares eachinteger with the 11th integer, and displays…
A: Note: In this question, the coding language is not specified then we are doing this question in the…
Q: Write a program that prompts the user to enter a positive integer and obtains its square root in…
A: Given data is shown below:
Q: Write a program that takes a date as input and outputs the date's season. The input is a string to…
A: Given: Write a program that takes a date as input and outputs the date's season. The input is a…
Q: Write a program that takes a date as input and outputs the date's season. The input is a string to…
A: Please find the answer below :
Q: Write a program that takes in three integers and outputs the largest value. Ex: If the input is: 1…
A: the solution to your problem is with screenshot and code
Q: Write a program that plays a number guessing game with a Human user. The Human user will think of a…
A: // do comment if any problem arises //code #include <iostream> using namespace std; //this…
Q: Write an algorithm that accepts a 2-digit number ranging from 20 to 99 and display all pair of…
A: Write an algorithm that accepts a 2-digit number ranging from 20 to 99 and display all pair of…
Q: (JAVA) Write a program that allows the user to enter the last names of five candidates in a local…
A:
Q: Write a program that will receive a user input of any POSITIVE integer. The 1 #include <stdio.h…
A: Hello Student Greetings Hope you are doing great I will try my best to answer your question Thank…
Q: import random x = random.randint (0,5) if x == 5: print (x,' Zero') elif x == 4: print (x, 'One')…
A: random.randint(0,5) generates random number between 0-5
Q: Write a program that reads the width, height and a character from the user, then calculates the…
A: Code import java.util.Scanner;public class Main{ public static void main(String[] args) {…
Q: Write a program that inputs one five-digit number, separates the number into its individual digits…
A: //C++ program #include <iostream> using namespace std; int main(){ int n,a[5],i=4;…
Q: Given this function below: int tribonacci(int n) { if (n<=3) return 3; else return tribonacci (n-1)…
A: 1) The tribonacci numbers are like the Fibonacci numbers, but instead of starting with two…
Q: Given a non-negative int n, return the count of the occurrences of 7 as a digit, so for example 717…
A: the program is given below:-
Q: Write a program called p3.py that prints out a classic hangman stick figure. The program should ask…
A: We need to create the program according to the given output for the hangman in python.
Q: Write a program that takes in a line of text as input, and outputs that line of text in reverse. The…
A: required: Write a program that takes in a line of text as input, and outputs that line of text in…
Q: Sites like Zillow get input about house prices from a database and provide nice summaries for…
A: Given the source code Take the input of house prices And compute monthly mortgage.
Q: Sites like Zillow get input about house prices from a database and provide nice summaries for…
A: Here I have corrected the code in the Java programing language so the expected output is viewed. I…
Q: Please write a program which asks for the user's name. If the name is anything but "Jerry", the…
A: To find the error in the given code: name = input("Please tell me your name: ")if name == "Kramer":…
Q: Write a program that takes a date as input and outputs the date's season. The input is a string to…
A: Please find the answer below :
Q: Write a program that reads in a room number, the room's capacity, and the size of the class enrolled…
A: - We need to code the seat problem in C.
Q: Redo Exercise 4 so that the customer can select multiple items of a particular type. A sample output…
A: #include<iostream>#include<iomanip>using namespace std;string menu[8];double…
Q: What is the output of the code segment below? Hint: Draw a 2x3 grid and then fill it in.…
A: PROGRAM: //Defining the class class Main { //Defining the main() public static void…
Q: Write a program that asks a user to input non-negative integers (numbers that are >=0) until the…
A: I have provided C++ CODE along with CODE SCREENSHOT and 2- OUTPUT SCREENSHOTS----
Q: Write a program that takes a date as input and outputs the date's season. The input is a string to…
A: Below is the code in C++ as language not mentioned and sample output:
Q: Find the output of the following program? for x-3:-1:1 for y-1:2:x z = x*y+x; fprintf ('&'); end…
A: Loop statement purpose: for x = 3:-1:1 It runs for x value 3 to 1 Every time the value of x is…
Q: Write a program whose input is two integers. Output the first integer and subsequent increments of 5…
A: - The question we have is to highlight the scenario in the form of the code. We need to code this…
Q: CHALLENGE ACTIVITY 5.8.2: Nested loops: Print seats. Given num_rows and num_cols, print a list of…
A: PROGRAM CODE: num_rows = int(input())num_cols = int(input())#create a number to start counting from…
Q: Write a program (Lab8_ex4_ld.py) that generates a random even positive integer less than 10 and…
A: Python code is given below with comment for better understanding.
Q: On a piano, a key has a frequency, say fo. Each higher key (black or white) has a frequency of f0 *…
A: Java code: import java.util.Scanner; public class Main{ public static void main(String[] args)…
Q: Write a program that takes a date as input and outputs the date's season. The input is a string to…
A: Please find the answer below :
Q: Write a program that takes a date as input and outputs the date's season in the northern hemisphere.…
A: month = input ("Input the month (e.g. January, February etc.): ")#Declaration of monthName day = int…
Q: a program that simulates flipping a coin to make decisions. The input is how many decisions are…
A: heads_or_tails() input 1 TypeError: heads_or_tails() missing 1 required positional argument:…
Q: Write a program that generates a random number between 1 and 50 and asks the user to guess it. As a…
A: EXPLANATION: - The program involves these main tasks: - Generate the random number in range 1 to…
Q: Write a program that reads in a room number, the room's capacity, and the size of the class enrolled…
A: I am compelled to solve only one question due to company policies. Please post the Flow Chart…
Q: Input a line of text containing numbers, and determine whether any two consecutive numbers add up to…
A: I've executed your code and it is running correctly. Incase there is any indentation problem please…
Assign avg_owls with the average owls per zoo. Print avg_owls as an integer.
Sample output for inputs: 1 2 4 Average owls per zoo: 2
num_owls_zooB = int(input())
num_owls_zooC = int(input())
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- Write a program that takes in an integer in the range 11-100 as input. The output is a countdown starting from the integer, and stopping when both output digits are identical. Ex: If the input is: 93 the output is: 93 92 91 90 89 88 Ex: If the input is: 11 the output is: 11 Ex: If the input is: 9 or any value not between 11 and 100 (inclusive), the output is: Input must be 11-100 this is what i have n = int(input())if n > 100 or n < 11:print('Input must be 11-100')exit(0)while True:print(n, end=" ")first_digit = n // 10second_digit = n % 10 if first_digit == second_digit:break n = n-1 my output is 93 92 91 90 89 88 but it needs to be 93 92 91 90 89 88Write a program that simulates flipping a coin to make decisions. The input is how many decisions are needed, and the output is either heads or tails. Assume the input is a value greater than 0. Ex: If the input is: 3 the output is: heads heads tails import randomdef heads_or_tails(number_of_flips): i=0 while i<number_of_flips: temp=random.randint(0,1) if temp: print("tails",end='') print() if temp==0: print("heads",end='') print() i=i+1 if __name__ == '__main__': random.seed(1) number_of_flips = int(input()) heads_or_tails(number_of_flips) it says heads_or_tails() input 1 TypeError: heads_or_tails() missing 1 required positional argument: 'number_of_flips' heads_or_tails() input 5 TypeError: heads_or_tails() missing 1 required positional argument: 'number_of_flips' heads_or_tails() input 10 TypeError: heads_or_tails() missing 1 required positional argument:…For example, the input: S 1 100.00C 2 200.00S 5 500.00C 4 20.00q1 D 50.002 W 250.002 W 50.005 W 450.005 W 200.002 D 50.002 D 100.004 W 10.00-1must generate the following output: Error: withdrawal from account No.2 not allowedError: withdrawal from account No.5 not allowedError: deposit into account No.2 not allowedSavings Account Number: 1 Balance = 150.0Credit Account Number: 2 Balance = 0.0 limit = 200.0Savings Account Number: 5 Balance = 50.0v Credit Account Number: 4 Balance = 10.0 limit = 20.0v import java.util.ArrayList;import java.util.Scanner; public class LabProgram { public static int find(ArrayList<Account> accounts, int acctNo) { for (int i = 0; i < accounts.size(); i++) if (accounts.get(i).getAcctNo() == acctNo) return (i); return (-1); } public static void display(ArrayList<Account> accounts) { /* Displays account information for eaach account in accounts */ /* Type your code here */…
- Input a line of text containing numbers, and determine whether any two consecutive numbers add up to 10. Print True if two such numbers exist, and False otherwise. If there are fewer than two numbers in the input string, print False. Examples: If input string is "2 5 4 6 3", output is True since 4 + 6 is 10 If input string is "2 5 4 3 6", output is False If input string is "3 42 2 9 27 137 -127 66 99", output is True since 137 + -127 is 10Implement a game of Pig where the user plays against a "hold at 20 or goal" computer player that rolls until a 1 ("pig") is rolled, or the turn total is greater than or equal to 20, or the score plus the turn total is greater than or equal to 100. The first player is chosen randomly. An empty input (i.e., Enter) indicates that the user wishes to roll. Any entered line of non-zero length indicates that the user wishes to hold. Before the game, randomly select which player the user will be, and print the line "You will be player #.", where # is the user's player number. Then, print an instruction line "Enter nothing to roll; enter anything to hold." Before each turn, print a line with "Player 1 score: " and player 1's score. Print another line with "Player 2 score: " and player 2's score. Finally, print a line with "It is player #'s turn.", where "#" is replaced by the current player number. Play starts with player 1 and then alternates. For each roll, print a line with "Roll: "…Write a program that takes in three integers and outputs the largest value. Ex: If the input is: 1 2 3 the output is: 3 This is what i have: num_1 = int(input())num_2 = int(input())num_3 = int(input()) def number(num_1,num_2, num_3): if num_1 > num_2 or num_3 > num_2: return num_3 else: return max(number) print (number(num_1,num_2,num_3)) it says Traceback (most recent call last): File "main.py", line 12, in <module> print (number(num_1,num_2,num_3)) File "main.py", line 10, in number return max(number) TypeError: 'function' object is not iterable Input 42 510 33 Your output Your program produced no output Expected output 510 and: Input 6 5 5 Your output 5 Expected output 6 and: Traceback (most recent call last): File "main.py", line 12, in <module> print (number(num_1,num_2,num_3)) File "main.py", line 10, in number return max(number) TypeError: 'function' object is not iterable Input -8 0 -1 Your output…
- Write a program that simulates flipping a coin to make decisions. The input is how many decisions are needed, and the output is either heads or tails. Assume the input is a value greater than 0. Ex: If the input is: 3 the output is: heads heads tails import randomdef heads_or_tails(n): i=0 n = 'n' while i<n: num = random.randint(0,1) if num==0: print('heads') else: print('tails') i+=1 if __name__ == '__main__': random.seed(1) number_of_flips = int(input()) heads_or_tails(number_of_flips) it says the problems with my code are: heads_or_tails() input 1 TypeError: heads_or_tails() missing 1 required positional argument: 'n' heads_or_tails() input 5 TypeError: heads_or_tails() missing 1 required positional argument: 'n' heads_or_tails() input 10 TypeError: heads_or_tails() missing 1 required positional argument: 'n'Write a program that takes a **string** as input and outputs “Binary Number” if the string contains only 0s or 1s. Otherwise, outputs “Not a Binary Number”. ===================================================================== **Sample Input 1:**\01101101101 **Sample Output 1:**\Binary Number ===================================================================== **Sample Input 2:**\12344ab0 **Sample Output 2:**\Not a Binary Number ===================================================================== **Sample Input 3:**\10127490111 **Sample Output 3:**\Not a Binary Number ===================================================================== **Sample Input 4:**\Binary Number **Sample Output 4:**\Not a Binary Number #todo#assign the result string to variable "out_str"def task3(in_str): # YOUR CODE HERE return out_strWrite a program that takes in an integer in the range 20-98 as input. The output is a countdown starting from the integer, and stopping when both output digits are identical. Ex: If the input is 93, the output is: 93 92 91 90 89 88 Ex: If the input is 77, the output is: 77 Ex: If the input is not between 20 and 98 (inclusive), the output is: Input must be 20-98 For coding simplicity, follow each output number by a space, even the last one. Use a while loop. Compare the digits; do not write a large if-else for all possible same-digit numbers (11, 22, 33, ..., 88), as that approach would be cumbersome for large ranges.
- Using Paython Write a program that asks a student for his grade (out of 100) in 3 exams and then print out his final grade (out of 100), given that the weight of the first exam is 30%, the second 30%, and the third 40%.Example Input:Exam1: 70Exam2: 80Exam3: 90Example Output:Total Grade = 81Explanation: 0.3 * 70 + 0.3 * 80 + 0.4 * 90 = 81Write a program that takes in an integer in the range 11-100 as input. The output is a countdown starting from the integer, and stopping when both output digits are identical. Additionally, output the distance between the starting and ending numbers (ex: 93 - 88 = 5) Note: End with a newline. Ex: If the input is: 93 the output is: 93 92 91 90 89 88 5 Ex: If the input is: 11 the output is: 11 0 Ex: If the input is: 9 or any value not between 11 and 100 (inclusive), the output is: Input must be 11-100 For coding simplicity, follow each output number by a space, even the last one. Use a while loop. Compare the digits; do not write a large if-else for all possible same-digit numbers (11, 22, 33, …, 99), as that approach would be cumbersome for larger ranges. Hint: To practice incremental development, start by writing code that just outputs the countdown until matching digits and submit to get most of the points. Then, update your code to output the distance.On a piano, a key has a frequency, say f0. Each higher key (black or white) has a frequency of f0 * rn, where n is the distance (number of keys) from that key, and r is 2(1/12). Given an initial key frequency, output that frequency and the next 4 higher key frequencies. Output each floating-point value with two digits after the decimal point, which can be achieved as follows:print('%0.2f %0.2f %0.2f %0.2f %0.2f' % (your_value1, your_value2, your_value3, your_value4, your_value5))