Questions: 5 831

Answers by our Experts: 5 728

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

Write a program that allows the user to input his/her full name (assuming that the last

word will be the surname). The program should then respond by telling the user the

following:

i) The number of names that he/she has.

ii) The user’s firstname.

iii) The user’s surname.

iv) The full name without the spaces.

v) The number of characters in the name.

vi) The number of unique characters in the name.


Write a Python program that does the following. 

  • Create a string that is a long series of words separated by spaces. The string is your own creative choice. It can be names, favorite foods, animals, anything. Just make it up yourself. 
  • Turn the string into a list of words using split
  • Delete three words from the list, but delete each one using a different kind of Python operation. 
  • Sort the list. 
  • Add new words to the list (three or more) using three different kinds of Python operation. 
  • Turn the list of words back into a single string using join
  • Print the string. 

Part 2

Create your own examples using python lists

  • Nested lists 
  • The “*” operator 
  • List slices 
  • The “+=” operator 
  • A list filter 
  • A list operation that is legal but does the "wrong" thing, not what the programmer expects 

Provide the Python code and output for your program and all your examples. 

 

 



import time
nucleotides="ATGC"
nulength= len(nucleotides)
nucleostring=""
noofbase=0
inputbase= int(input("Enter the number of base: "))
while noofbase < inputbase:
rand=int(time.time_ns())
randomno=rand%nulength
nucleostring+=nucleotides[randomno]
noofbase+=1
print(nucleostring)
print("Forward: ")
print("DNA Seq")
if len(nucleostring)%3 == 0:
for i in range(0, len(nucleostring),3):
c= nucleostring[i: i+3]
print(c)
but i need output in horizontal line
output Enter the number of base: 6
TACGCTTCTCGTGCCTCCTCCGCTGCGATCCAACCA
Forward:
DNA Seq
TAC
GCT
Write a python code for below problem,
We have a list
Input = [5,'Unnamed: 1','Unnamed: 2','Unnamed: 3', 6, 'Unnamed: 5','Unnamed: 6']
want to convert it into: Output= [5,5,5,5,6,6,6]

Create a program that reads integers from the user until a blank line is entered. Once

all of the integers have been read your program should display all of the negative

numbers, followed by all of the zeros, followed by all of the positive numbers.Within

each group the numbers should be displayed in the same order that they were entered by the user. For example, if the user enters the values 3, -4, 1, 0, -1, 0, and -2 then

your program should output the values -4, -1, -2, 0, 0, 3, and 1.display each value on its own line.


I think it's already a given that two sentences combined will always be longer than a single sentence alone, but to prove just how long two sentences can be, why don't we let our program show the combined length of the two randomly inputted strings?

Let's get it on!


Input

Two lines containing a string on each.

Python·is·fun
I·love·CodeChum





 for i in range(0,len(displayList)):
                #Test if the fist item in the current sub-list contains the text "Price Level
                #Tip: Remeber that each sub-list is a (displayList). So you have
                #to access its items via displayList followed by TWO indexes.
                if i == "Price Level":

                    #Extract the second item from the current sub-list into variable called priceLevel
                    priceLevel = i
                #Test if priceLevel is between previousPrice and currentPrice OR
                #        pL == pP OR
                #    pL == cP
                if priceLevel >= previousPrice and priceLevel <= currentPrice or priceLevel == previousPrice or priceLevel == currentPrice:


                    if self.__currentPrice <= self.__previousPrice:
                        frequency = 400
                        duration = 700
                    #Sound the alarm. Pass in the frequency, duration.
                    else:
                        frequency = 800
                        duration = 700
                    winsound.Beep(frequency, duration)
                    #Print the text 'Alarm' 
                    #can go back and check when the alarm was sounded.
                    print(Back.GREEN + "Alarm" + Style.RESET_ALL)

if __name__ == '__main__':
    displayList = ['Price level']
    play = Play()
    # function call
    play.ls(0, 100)




celicus to Fahrenheit

In a right triangle, the square of the length of one side is equal to the sum of the squares of the lengths of the other two sides. Write a program that prompts the user to enter the length of the three sides of a triangle and then outputs a message indicating whether the triangle is a right triangle. Use functional programming paradigm on this problem.  


If Input coefficients are negative values, the output will be wrong.How to get output if coefficients are negative?
LATEST TUTORIALS
APPROVED BY CLIENTS