Question

1.Use turtle to draw two flags of two countries whose names start with the same letters...

1.Use turtle to draw two flags of two countries whose names start with the same letters as your first names(A andH). Use for loop whenever possible

2.

Write a Python function that implements the following algorithm that computes the sum of the first n non-negative powers of 2: 20 + 21 + ... + 2n-1, where n ≥ 0:

1. Input n (assume n ≥ 0)

2. Set sum to 1

3. Set value to 2

4. Do the following n-1 times:

   a. Add value to sum

   b. Multiply value by 2

5. Output sum

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

1. Austrian flag

Hungarian flag

2. Program:

Output:

Add a comment
Know the answer?
Add Answer to:
1.Use turtle to draw two flags of two countries whose names start with the same letters...
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
  • 1. Write a Python function that implements the following algorithm that computes the sum of the...

    1. Write a Python function that implements the following algorithm that computes the sum of the first n non-negative powers of 2: 20 + 21 + ... + 2n-1, where n ≥ 0: 1. Input n (assume n ≥ 0) 2. Set sum to 1 3. Set value to 2 4. Do the following n-1 times:    a. Add value to sum    b. Multiply value by 2 5. Output sum 2.Use turtle to draw two flags of two countries...

  • PROOFS: Use these theorems and others to prove these statements. Theorem 1: The sum of two...

    PROOFS: Use these theorems and others to prove these statements. Theorem 1: The sum of two rational numbers is rational. Theorem 2: The product of two rational numbers is rational. Theorem 3: √ 2 is irrational. Induction: Prove that 6 divides n 3 − n for any n ≥ 0 Use strong induction to prove that every positive integer n can be written as the sum of distinct powers of 2. That is, prove that there exists a set of...

  • Create a Python list (use first three letters of your name followed by the letter L...

    Create a Python list (use first three letters of your name followed by the letter L as the name of the list.) with the following data: 10, 20.0, 50.00, 7000, 7500, 7700, 7800, 8000, 9000, ‘python’. Display the entire list with an appropriate message. Display the 4th element in the list with an appropriate message. Display the first 3 values of the list only. Display all the values starting from the sixth element to the end of the list. Change...

  • The following are short Python calculations. Give the answer and the Python code for each. 1....

    The following are short Python calculations. Give the answer and the Python code for each. 1. What is the sum of the numbers from 22:100 incrementing by 2? Do this in two ways: Use a while statement and a for loop to do the calculation. (Hint: make sure the numbers include 100) 2. What is the mean, standard deviation of the square root of the numbers from 3 to 5 incrementing by 0.1? Use the linspace function from the numpy...

  • 1) Translate the following equation into a Python assignment statement 2) Write Python code that prints...

    1) Translate the following equation into a Python assignment statement 2) Write Python code that prints PLUS, MINUS, O ZERO, depending on the value stored in a variable named N. 3) What is printed by: 3 - 1 while 5: while 10 Print ) Page 1 of 9 4) Write a Python while loop that reads in integers until the user enters a negative number, then prints the sum of the numbers. 1-2 of 9 4) Write a Python while...

  • Let us define the overlap between two words as the count of unique letters they have...

    Let us define the overlap between two words as the count of unique letters they have in common. Thus, the overlap between JANE and MICK is 0. Here are some more examples: - The overlap between JANE and MIKE is 1 (E is common) - The overlap between JANE and MEEK is 1 (E is common; we do not double count a letter) - The overlap between JANE and JEDI is 2 (J and E are common) - The overlap...

  • ANSWER USING JAVA CODE (1)The sum of the squares of the first ten natural numbers is,...

    ANSWER USING JAVA CODE (1)The sum of the squares of the first ten natural numbers is, 12 + 22 + ... + 102 = 385 The square of the sum of the first ten natural numbers is, (1 + 2 + ... + 10)2 = 552 = 3025 Hence the difference between the sum of the squares of the first ten natural numbers and the square of the sum is 3025 − 385 = 2640. Find the difference between the...

  • Exercise 1 Use Top-Down Design to “design” a set of instructions to write an algorithm for...

    Exercise 1 Use Top-Down Design to “design” a set of instructions to write an algorithm for “travel arrangement”. For example, at a high level of abstraction, the algorithm for “travel arrangement” is: book a hotel buy a plane ticket rent a car Using the principle of stepwise refinement, write more detailed pseudocode for each of these three steps at a lower level of abstraction. Exercise 2 Asymptotic Complexity (3 pts) Determine the Big-O notation for the following growth functions: 1....

  • NOTE: Write the Program in python as mentioned below and use while loop and flags as...

    NOTE: Write the Program in python as mentioned below and use while loop and flags as necessary. And please write the code following the program description given below. Directions: Read the program description below carefully. All requirements must be met by your program to receive full credit. Thus, pay particular attention to input and output requirements, structural requirements, and so on. Furthermore, code that contains syntax errors will not receive any credit, so be sure that your code interprets correctly...

  • Python Algorithm Coding There are N paper with three letters written on each paper. Characters are 0 to 9 digits or *.Yo...

    Python Algorithm Coding There are N paper with three letters written on each paper. Characters are 0 to 9 digits or *.You can create a continuous number by attaching the paper in a proper order. Print out the maximum number of digits sum of a sequence of numbers that can be made when N paper is given. For example, suppose you have a piece of paper with a lettering as shown below. In this case, the consecutive numbers of strings...

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