Question

This Python program will need to include the following items listed below. You are to customize...

This Python program will need to include the following items listed below. You are to customize your program and create the sequence in any order of your choice. Write in simple code.

  • Must include Python comments for each of the items show below.
  • Calculate a Percentage. For example, the discount percentage on a sale item.
  • Use of 3 Constants. To be used for values that will not change throughout the life of the program.
  • A Turtle Graphic Logo. This logo will be used to depict your fictitious company and should be something interesting and creative.
  • Three (3) If-else Conditions. The usage of conditions is required and should be used to evaluate or make a decision on some kind of input. These can include the comparison of Strings or depict a nested conditional sequence.
  • The Usage of at Least 2 Logical Operators
  • 2 While Loops.
  • 1 For Loop
  • At Least 2 Functions (1 with at least 1 parameter)
  • 1 Instance of a List + Looping Through the List
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Points to consider:

  1. We need to add the turtle functionality in it.
  2. We added three function into it, while loop and for loops.

Code

import turtle as t
import time
def function1(name):
    if name == 'John':
        print("You are allowed")
    elif name == 'Harry':
        print("You are allowed")
    else:
        print('You are not allowed')

    print("Following students are present")

def function2():
    print("Following are the students")
    for x in range(10):
        print(x)


def function3(list):
    print("Following are allowed for the party")
    for allowed in list:
        print(allowed)

i = 3
j = 2
hor_dis = 20
ver_dis = 25
while i != 0:
    t.forward(hor_dis)
    t.left(40)
    j = 2
    while j != 0:
        t.forward(ver_dis)
        t.right(30)
        t.forward(hor_dis)
        j -= 1
    i -= 1
time.sleep(1)
list = ['John', 'Harry']
name = str(input('Enter name'))
function1(name)
function2()
function3(list)



Code Snippet:

Sample Output

Friend, That was a nice question to answer
If you have any doubts in understanding do let me know in the comment section. I will be happy to help you further.
Please like it if you think effort deserves like.
Thanks

Add a comment
Know the answer?
Add Answer to:
This Python program will need to include the following items listed below. You are to customize...
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
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