Question 1: Write a python program that finds all numbers divisible by 7 but not multiple of 5. The range of number for searching is between 2000 and 3200 (both included). Output should be printed in a comma-separated sequence on a single line .
CODE:
n=[] #take n as empty list
for x in range(2000,3201): #take range from 2000 to 3200
if(x%7==0) and(x%5!=0): # condition divisible of 7 and not multiple
of 5
n.append(str(x)) #append to empty list n
print(','.join(n)) #print separated with single line
num=[]
for i in range(2000,3200):
if(i%7==0) and (i%5!=0):
num.append(i)
print(num)
Question 1: Write a python program that finds all numbers divisible by 7 but not multiple...
Write a program in python using lists or tuples that asks for two positive integers n1 and n2 and prints out all the numbers that are divisible by 7 but are not a multiple of 5 within the range [n1,n2] (both included). The numbers obtained should be printed in a comma-separated sequence on a single line.
use python to print numbers which are divisible by 7 and multiple of 5, between 1500 and 2700 (both included). NOTE: use a while loop and for loop at different time
8.(a) Write a program that prints all of the numbers from 0 to 102 divisible by either 3 or 7. (b) Write a program that prints all of the numbers from 0 to 102 divisible by both 3 and 7 (c) Write a program that prints all of the even numbers from 0 to 102 divisible by both 3 and 7 (d) Write a program that prints all of the odd numbers from 0 to 102 divisible by both...
python format: write a program that displays, 10 numbers per line, all the numbers from 100 to 200 that are divisible by 5 or 6, but not both. The numbers are separated by exactly one space My Code: count = 0 for i in range (100, 201): if (i %6==0 and i %5!=0) or (i%5==0 and i%6!=0): print(str(i), "") count = count + 1 if count == 10: string = str(i) + str("") print(string)...
Write a python program that uses a while loop to print numbers 100,98,96... all the way to 0. each number should be printed on a seperate line
Question 4-6 Please. Python 3.6. def main(). entered by a user. Write a program that finds the sum and average of a series of numbers he program should first prompt the user to enter total numbers of numbers are to be summed and averaged. It should then as for input for each of the numbers, add them, and print the total of the numbers and their average 2. Write a progra m that finds the area of a circle. The...
C programming question! Write a program that reads two numbers and finds the greater one. The input is two integers and the output will be a single line “The maximum of ? and ? is ?.”, where ? and ? are the input values and ? is the maximum of ? and ?. If ? and ? are equal, ? will be equal to both of them. Example of input: 10 20 Corresponding output: The maximum of 10 and 20...
write the solution of the program by python 3 language : I need the program using list or string or loops (while and for) or if,elif,else : Alex got a sequence of n integers a1,a2,…,an as a birthday present. Alex doesn't like negative numbers, so he decided to erase the minus signs from all negative numbers. As a result, he got a sequence of non-negative numbers. Print the resulting sequence. For example, if the sequence is 1, 5, -3, 4,...
5. Write a program in, "Python" that reads 2 numbers from the user. The program should then print out whether the first number is evenly divisible by the second number.
Python 3 Write a program that calculates the factorial of the greatest odd number in a sequence of positive numbers (separated by spaces). The program must receive sequences of integers, one per line. The end of the input cases will be indicated by the number -1. For each line the program must print the factorial of the greatest odd number in each sequence. Note that for this question, there is always a greatest positive odd number in each line. Sample...