by CodeChum Admin
Let's try defining the size of the list and create the contents of it on our own! And then, to give off a sense of excitement, let's try accessing the value of a list element in a random index position!
Let's do this fast!
Input
The first line contains an integer n which is the size of the array.
The next n lines contains a string on each.
The last line contains an integer which is the index to be accessed and printed.
6
Learning
Programming
made
easy
with
Cody!
5Output
A line containing a string.
Cody!by CodeChum Admin
Counting off a list of decimal numbers is hard when you speak it, but not when you code it! Don't believe me? Then let's try coding just that!
Instructions
Output
Multiple lines containing a decimal number.
5.1
5.5
4.00001
4.024
3.0
3.66
2.5
2.2
1.2054
1.4by 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
.
.
.by CodeChum Admin
Lists are fun to make, but it's even better to add or remove things from it when it's not usable anymore, right? Let's do just that in this problem now!
Instructions
Input
Two lines containing a string.
fun
PythonOutput
A line containing a string.
Python·is·really·funa = 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 figure this out.
write a program the temperature value is 25 C the output is 25.0C and 77.of and 298.0k in python
write a program if input is temperature as 25 output is 25.0c and 77.0f
draw a flowchart of connecting django project to database
Write a python application using the concepts of multithreading for a flower
shop where flowers are delivered based on order using Synchronization.
Write a simulation program with Synchronization for the fruit market. The
farmer will be able to produce different types of fruits (apple, orange, grape,
and watermelon), and put them in the market to sell. The market has limited
capacity and farmers have to stand in a queue if the capacity is exceeded to
sell their fruits. Consumers can come to the market any time and purchase
their desired fruits; and if the fruits they want to buy runs out, they are
willing to wait until the supply of that kind is ready. (Hint: implementing
this market will encounter the producer and consumer problem, and it
probably needs multiple buffers for different kinds of fruits).