Question

PUT IN PITHON CODE use a for loop to print every fourth number starting from 402...

PUT IN PITHON CODE

use a for loop to print every fourth number starting from 402 ( 402, 406,410,...) but do not print any number higher than 506.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

for i in range(402,507,4):
print(i,end=' ')

Add a comment
Know the answer?
Add Answer to:
PUT IN PITHON CODE use a for loop to print every fourth number starting from 402...
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
  • Objectives: Use the while loop in a program Use the do-while loop in a second program...

    Objectives: Use the while loop in a program Use the do-while loop in a second program Use the for loop in a third program Instructions: Part A. Code a for loop to print the Celsius temperatures for Fahrenheit temperatures 25 to 125. C = 5/9(F – 32).Output should be in a table format: Fahrenheit Celsius 25 ? . . . . . . . . Turn in the source and the output from Part A. Part B. Code a while...

  • how to write a for loop that prints out every 5th number (starting at 0) up...

    how to write a for loop that prints out every 5th number (starting at 0) up to 100 using the range function in python. please explain in python.

  • def st_petersburg_lottery(): print("###### St. Petersburg Lottery ######") print("Instructions:") print("You will select any number greater than 0.")...

    def st_petersburg_lottery(): print("###### St. Petersburg Lottery ######") print("Instructions:") print("You will select any number greater than 0.") print("Up to the number of times you chose, we will randomly choose 0 or 1.") print("If a 1 is chosen before the last drawing, then you lose.") print("If a 1 does not appear at all, then you lose.") print("You win if 1 is chosen for the first time exactly on the last drawing.") print() def first_to_a_word(): print("###### First to a Word ######") print("Instructions:") print("You...

  • This is java. Please let me know about those code. Please do not use array and...

    This is java. Please let me know about those code. Please do not use array and scanner. Just do by loop. // a) Task: Find the sum of all multiples of 3 and 5 less than 1000. // b) Task: Given two integers k and n, print out every multiple of k less than n // c) Task: Given an integer n, print out k^k for every k=1...n // d) Task: Write a function called "factorProduct" that takes as input...

  • PYTHON CODE: Write a program that uses a while loop to examine every integer from 999...

    PYTHON CODE: Write a program that uses a while loop to examine every integer from 999 down to zero and generate the exact same output as shown blow. The range function is not required. NOTE: you must use a while loop. Required Output 960 920 880 840 800 760 720 680 640 600 560 520 480 440 400 360 320 280 240 200 160 120 80 40

  • a) use for loop to get the ascii code from ‘A’ to ‘Z’ with the following...

    a) use for loop to get the ascii code from ‘A’ to ‘Z’ with the following format: A - - - - ?(a number) B - - - - ?(another number) . . Z - - - - ?(the ascii code of ‘Z’) b) verify ‘A’ > ‘z’ or ‘a’ > ‘Z’ c) what will be printed for expression 3344.996 with this format string %012.05f or %12.05f or %-12.05f or %-012.5f? d) read a float number to a float variable...

  • How do I write this code from while loop to for loop? (this is the whole...

    How do I write this code from while loop to for loop? (this is the whole code) NOTE: do not add any import other than: import java.util.ArrayList; import java.util.Collection;(collection not collections) import java.util.List; import java.util.Set; import java.util.TreeSet; import java.util.HashSet; code: public static int frequency(Collection values, int target) { var iter = values.iterator(); int app = 0; while (iter.hasNext()) { if(iter.next() == target) { app++; } } return app; } public static boolean isSorted(List list) { var iter = list.listIterator(); int...

  • Create a while loop that will execute the following code 12 times using a counter that...

    Create a while loop that will execute the following code 12 times using a counter that starts at 1 and is incremented by 1 each time through the loop. Within the while loop, create a switch statement that will print out the number of days in each of the months of the year. - Use fall through capabilities so that you only have one print statement for all of the months that contain 31 days. Do not worry about leap...

  • Here is my code to put a quote down, flip it, and reverse it. I do...

    Here is my code to put a quote down, flip it, and reverse it. I do not have much knowledge on coding. Does my code only use Variables, Console I/O, Java Program Design, Intro to IDEs, If Statements, Selection and Conditional Logic, Strings, Loops, Nesting, and Iteration? If not, could it be fixed to only use them? These are the offical steps of the assignment: - Ask a user to enter a quote - whether it's several sentences or a...

  • Java Write code for the problem: The user enters exactly 5 scores. Use a for loop...

    Java Write code for the problem: The user enters exactly 5 scores. Use a for loop to input the scores and count the number of scores that are greater or equal to 80. Print the result after all 5 scores have been entered.

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