Question

I need help with this python programming exercise, please! thanks in advanceCreate a Python script file called hw4.py. Add your name at the top as a comment, along with the class name and date. Both ex

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

#python code

"""
This program print the ASCII O
as per given length
"""
length = int(input("Enter length: "))
for i in range(0, length):
    if i == 0 or i == length-1:
        print(" *** ")
    else:
        print("*   *")

#Screenshot for indentation help

This program print the ASCII O as per given length length = int(input(Enter length: )) for i in range (0, length) : if i ==

#output

C:\Users\naren\PycharmProjects\printo\venv\Scrip Enter length: 6 *** Process finished with exit code o

//If you need any help regarding this solution ...... please leave a comment ...... thanks

Add a comment
Know the answer?
Add Answer to:
I need help with this python programming exercise, please! thanks in advance Create a Python script...
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
  • Python programming Question 1: Write a script with a for loop that prints each character in...

    Python programming Question 1: Write a script with a for loop that prints each character in your first name written as first initial capital and other small, followed by its ASCII value on the screen.  Use appropriate functions to get character value to ASCII code. (Hint: Functions discussed in lectures)  For example, the output of each iteration should be as -- for ‘A’, it should print A followed by its ASCII value. Question 2: Write a script that...

  • python Programming Exercise 4.7 Write a script that decrypts a message coded by the method used...

    python Programming Exercise 4.7 Write a script that decrypts a message coded by the method used in Project 6. Method used in project 6: Add 1 to each character’s numeric ASCII value. Convert it to a bit string. Shift the bits of this string one place to the left. A single-space character in the encrypted string separates the resulting bit strings. An example of the program input and output is shown below: Enter the coded text: 0010011 1001101 1011011 1011011...

  • A. Write a Python script so that the user can enter any number of grades. Create...

    A. Write a Python script so that the user can enter any number of grades. Create a calcavg() function so that it takes the number of grades as a parameter and returns the regular average (not a weighted average). You must loop through the grades for full credit. Add a try/except block so that if a non-numeric value is entered, you get the error message shown below. You cannot use lists. Input: c. python …\IT2430\FirstLastname\assign5-2.py 96.7 95.6 87.0 d. python...

  • This is in python. I need to print out a specific message depending on the number...

    This is in python. I need to print out a specific message depending on the number that's input. for example, if the user inputs 1, program should print out "hello". if the user inputs 2, program should print out "hi". But also the program should keep asking for a number to be input after a valid number is input. For example, user inputs 1, program prints out "hello" and then asks the user to input another value. but also the...

  • ((python programming)) 2. In this exercise you will create a program that reads a letter of...

    ((python programming)) 2. In this exercise you will create a program that reads a letter of the alphabet from the user. If the user enters a, e, i, o or u then your program should display a message indicating that the entered letter is a vowel. If the user enters y then your program should display a message indicating that sometimes y is a vowel and sometimes y is a consonant. Otherwise your program should display a message indicating that...

  • Programming Exercise 4.9 Write a script named numberlines.py. This script creates a program listing from a...

    Programming Exercise 4.9 Write a script named numberlines.py. This script creates a program listing from a source program. This script should: Prompt the user for the names of two files. The input filename could be the name of the script itself, but be careful to use a different output filename! The script copies the lines of text from the input file to the output file, numbering each line as it goes. The line numbers should be right-justified in 4 columns,...

  • USING PYTHON PLEASE Write a program that calculates the factorial value of a number entered by...

    USING PYTHON PLEASE Write a program that calculates the factorial value of a number entered by the user. Remember that x! =x* (x-1)* (x-2)*... *3+ 2* 1. Your program should check the value input by the user to ensure it is valid (i.e., that it is a number > =1). To do this, consider looking at the is digit() function available in Python. If the user enters an incorrect input, your program should continue to ask them to enter a...

  • PYTHON Programming short Questions: 1. Write a function takes as input name (string) and age (number)...

    PYTHON Programming short Questions: 1. Write a function takes as input name (string) and age (number) and prints: My name is <name> and I am <age> years old(where name and age are the inputs) 2. Write a function that takes as input a and b and returns the result of: ??ab 3. Write a function that takes as input a and b and returns the result of: ??ab if it is valid to divide a and b 4. Write a...

  • PYTHON CODE ONLY PLEASE, AND COMMENT IN SCRIPT TO SHOW STEPS (post copy-ready text code, and also...

    PYTHON CODE ONLY PLEASE, AND COMMENT IN SCRIPT TO SHOW STEPS (post copy-ready text code, and also a screenshot of code running) You work for an on-line game site. Your job is to develop a program that accepts a user name and password. Write a Python script that prompts users for a user name and password. a. The user name should be at least 6 characters long and is stored in a list such that it 1. can't be used...

  • In Python In this programming assignment, you will do multiple programming exercises, and eventually develop a...

    In Python In this programming assignment, you will do multiple programming exercises, and eventually develop a Python application that can calculate student course grades. (6 points) Write a program called p2-1.py to: (1) create a list and add integer numbers from 1 to 100 to the list; (2) calculate the average value of all numbers in the list; and (3) print the result (screenshots). (8 points) Write a program called p2-2.py to: (1) allow a user to define how many...

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