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

a = input("Enter an animal: "

s = input ("Enter a sound: )

   

e = "E"


print ("Old Macdonald had a farm, " + e)

print ("And on his farm he had a + a +  ","  e)

print ("With a " + a + "-" + a + " here and a" + s + "-" + s + " there")

print ("Here a "+ s+ " there a " s)

print ("Everywhere a"   s + "-" + a )

print ("Old Macdonald had a farm," + e)


can you please correct the wrong parts here?


1. Listing 101

by CodeChum Admin

I want you to make a array/list of numbers for me. All you have to do is make a program that will let me input any random integer in one line. Afterwards, it will then print out all the numbers I've inputted, on separate lines.

Care to do that for me?


Input

A line containing integers separated by a space.

1·64·32·2·11

Output

Multiple lines containing an integer.

1
64
32
2
11
1. Listing 101 by CodeChum Admin I want you to make a array/list of numbers for me. All you have to do is make a program that will let me input any random integer in one line. Afterwards, it will then print out all the numbers I've inputted, on separate lines. Care to do that for me? Input A line containing integers separated by a space. 1·64·32·2·11 Output Multiple lines containing an integer. 1 64 32 2 11
Write an algorithm to find the sum of all the prime numbers in the given range

Groupings

by CodeChum Admin

Did you know that you can also reverse lists and group them according to your liking with proper code? Let's try it to believe it.


Instructions

  1. Create a variable that accepts a positive odd integer.
  2. Create an empty list. Then, using loops, add random integer values into the list one by one. The number of values to be stored is dependent on the inputted odd integer on the first instruction.
  3. Reverse the order of the list. Then, print out the list's new order in this manner:
  4. [first-half values]-[middle value]-[second-half values], just like that of the sample output. Make use of list slicing that you’ve learned from the past lessons to easily achieve this segment.

Input

The first line contains an odd positive integer.

The next lines contains an integer.

5
1
3
4
5
2

Output

A line containing a list.

[2,5]-[4]-[3,1]

Cubes and Squares

by CodeChum Admin

You can also make a list of numbers, ey? Let's go and have some fun in tweaking the values of each element, but let's give it some twist to add on some fun to the code.

Let's have a go at it!

Instructions:

  1. An array containing 40 integer elements is already provided for you in the code editor below.
  2. Using loops and conditions, print out the cube of the array element if it is a positive number, and print out the square of the number if it is negative. Each result must be printed out separately by each line.

Instructions

  1. A list containing 5 integer elements is already provided for you in the code editor below.
  2. nums = [-2, -1, 1, 2, 3]
  3. Using loops and conditions, print out the cube of the list element if it is a positive number, and print out the square of the number if it is negative. Each result must be printed out separately by each line.

 

Output

The squares and cubes of the elements in the array.

4

1

1

8

27

.

.

.


I need help finishing a coding project for a computer science class, I don't know how to start it


you are given N inputs. wirte a program to print first prime number in given inputs.


Input 1

5

1

10

4

3

2


input 2

4

2

3

5

7


6. The Big One

by CodeChum Admin

Remember that time when we've tried identifying the largest digit among the given integer? Well, let's take it to the next level, and figure out the same thing on arrays/lists!

Let's do this one more time!


Instructions

  1. Create a variable that accepts a positive integer.
  2. Create an empty list. Then, using loops, add random integer values into the list one by one. The number of values to be stored is dependent on the inputted positive integer given in the first instruction.
  3. Print out the largest integer among all the elements on the list, by any means necessary.

Input

The first line contains the size of the array/list.

The next lines contains an integer on each.

5
5
34
3
23
10

Output

A line containing an integer.

34

5. Groupings

by CodeChum Admin

Did you know that you can also reverse lists and group them according to your liking with proper code? Let's try it to believe it.


Instructions

  1. Create a variable that accepts a positive odd integer.
  2. Create an empty list. Then, using loops, add random integer values into the list one by one. The number of values to be stored is dependent on the inputted odd integer on the first instruction.
  3. Reverse the order of the list. Then, print out the list's new order in this manner:
  4. [first-half values]-[middle value]-[second-half values], just like that of the sample output. Make use of list slicing that you’ve learned from the past lessons to easily achieve this segment.

Input

The first line contains an odd positive integer.

The next lines contains an integer.

5
1
3
4
5
2

Output

A line containing a list.

[2,5]-[4]-[3,1]
LATEST TUTORIALS
APPROVED BY CLIENTS