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?
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·11Output
Multiple lines containing an integer.
1
64
32
2
11by 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
Input
The first line contains an odd positive integer.
The next lines contains an integer.
5
1
3
4
5
2Output
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:
Instructions
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
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
Input
The first line contains the size of the array/list.
The next lines contains an integer on each.
5
5
34
3
23
10Output
A line containing an integer.
34by 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
Input
The first line contains an odd positive integer.
The next lines contains an integer.
5
1
3
4
5
2Output
A line containing a list.
[2,5]-[4]-[3,1]