Question

Write a Python Program Write a program which reads a word, lower-cases all its letters, then...

Write a Python Program

Write a program which reads a word, lower-cases all its letters, then prints out a square array where the first row contains the word, and each subsequent line is the previous line circular-shifted one place to the left. Example for entered word word == "MoXiE":

moxie

oxiem

xiemo

iemox

emoxi

Try doing this any way you can.

Hint 1: lower-case word, then repeat the following len(word)times: (a) print word, (b) move first char of word to end.

Hint 2: lower-case word, then think about selecting len(word) characters from word+word - by slicing!

0 0
Add a comment Improve this question Transcribed image text
Answer #1
#Code.py
word = input("Enter word: ").lower()
for x in range(len(word)):
    print(word[x:]+word[:x])
Add a comment
Know the answer?
Add Answer to:
Write a Python Program Write a program which reads a word, lower-cases all its letters, then...
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 program that reads a file and prints the letters in increasing order...

    1. Write a python program that reads a file and prints the letters in increasing order of frequency. Your program should convert entire input to lower case and only counts letters a-z. Special characters or spaces should not be counted. Each letter and it's occurrences should be listed on a separate line. 2. Test and verify your program and it's output. ---Please provide a code and a screenshot of the code and output. Thank you. ----

  • Swap Cases - Write a python program to swap cases. LowerCase letters to Upper case and...

    Swap Cases - Write a python program to swap cases. LowerCase letters to Upper case and vice versa (10 points) Input : Www.PyDev.com Output: wWW.pYdEV.COM Input: Pythonist 2 Output: pYTHONIST 2 b) Manipulate Strings - Insert a sequence of characters into the specified position in the given String(10 points) Input : First Line contains the string to be manipulated Second Line contains the string to be inserted and the position Number Output : The modified string Sample Input & Output:-...

  • Write a Java program that reads a word and prints its bigrams substrings. A character bigram...

    Write a Java program that reads a word and prints its bigrams substrings. A character bigram is defined as a continuous sequence of two characters in a word. For example, if the user provides the input "rum", the program prints ru um Hint: 1. set two pointers, one always moves from the beginning of the string and the other moves from i+2, in which i is the current position of the first pointer. 2. print an error message if the...

  • C Program In this assignment you'll write a program that encrypts the alphabetic letters in a...

    C Program In this assignment you'll write a program that encrypts the alphabetic letters in a file using the Vigenère cipher. Your program will take two command line parameters containing the names of the file storing the encryption key and the file to be encrypted. The program must generate output to the console (terminal) screen as specified below. Command Line Parameters Your program must compile and run from the command line. The program executable must be named “vigenere” (all lower...

  • I need help programming this program in C. 1.) Write a program that reads a message,...

    I need help programming this program in C. 1.) Write a program that reads a message, then checks whether it's a palindrome (the letters in the message are the same from left to right as from right to left), example is shown below: Enter a message: He lived as a devil, eh? Palindrome Enter a message: Madam, I am Adam. Not a Palindrome 2.) Ignore all characters that aren't letters. Use integer variables to keep track of positions in the...

  • Do in Python Problem 2 Assume s is a string of lower case characters. Write a...

    Do in Python Problem 2 Assume s is a string of lower case characters. Write a program that prints the number of times the string ' lol' occurs in s For example, if s= 'azclololegghakl', then your program should print S Number of times lol occu rs is: 2 Problem 3 Assume s is a string of lower case characters Write a program that prints the longest substring of s in which the letters occur in alphabetical order. For example,...

  • PYTHON You are to write a program that will analyze the frequency of letters in a...

    PYTHON You are to write a program that will analyze the frequency of letters in a string. The user will enter a string, your program will output the number of times the letters of the alphabet appear in that string. The user is to enter a string that has upper or lower case letters only, no spaces or other characters. You should convert the string entered to all lowercase letters before you conduct your analysis.

  • Write a program that reads a string from the keyboard and computes the two arrays of...

    Write a program that reads a string from the keyboard and computes the two arrays of integers upperCase, and lowerCase, each of size 26. The first one represents the frequency of upper case letters and the second one represents the frequency of lower case letters in the input string. After computing these arrays, the program prints the frequencies in the following format: The frequency of the letter A= The frequency of the letter B= Assume the input string contains only...

  • Write a program that reads a series of words (one word per line) from a file...

    Write a program that reads a series of words (one word per line) from a file named data.txt. Each word in the file should have each of its characters shifted by 1 character value in the ASCII table (incremented) and then that new word with its characters shifted should be printed to a new file named result.txt. Each word from data.txt should be reprinted with its new encoding in result.txt. Your program should not have any knowledge of how many...

  • Python 3 Write a program that reads a sequence of words and prints every word whose...

    Python 3 Write a program that reads a sequence of words and prints every word whose frequency is equal to its length. You can assume that there will always be a word that meets this condition. If more than one word have this condition, you must print first the most frequent one. If two or more words with equal frequencies meet this condition, print them from the smallest to the largest in alphabetical order. Sample Input lee john lee peter...

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