What will print from the following code?
book_title = "The Journey to the Center of the Earth"
title_words = book_title.split()
print(len(title_words))
What will print from the following code? book_title = "The Journey to the Center of the...
A spacecraft is on a journey to the moon. At what point, as measured from the center of the earth, does the gravitational force exerted on the spacecraft by the earth balance that exerted by the moon? This point lies on a line between the centers of the earth and the moon. The distance between the earth and the moon is 3.85 × 108 m, and the mass of the earth is 81.4 times as great as that of the...
In python What is the output of below code? print(len(“what’s up”))
Describe what is wrong with the syntax of each the following blocks of code, and show how to fix it. while answer != 'q': answer = input('Word? ') print(len(answer))
a spaceship of proper length 50 m is moving away from the earth at a speed of .8c . according to the observes in the ship , their journey takes 6.0 hours . according to observers on earth , what is the length of the ship and how long does the journey take ?
What is wrong with the following code snippet? print("Hello") print("World!") The print function cannot be called twice The print function is missing an argument Nothing, the program prints Hello World on the same line The second line should not be indented
6. From the following flow-chart, write the java code. false a<100 print Done true print Bad a++ 7. Given an array int[] myarray = {2, 4, 6, 8, 9, 7, 5, 3, 1, 0} Create a trace table for variables involved in the following code int s = 10; for (int i = 3; i <7; i++) S = S + myarray[i]; What is the final value of s? 8. Given an ArrayList object mywords of the content Avengers Endgame...
These are the answers, please provide the work for the calculation 1. Two cells that subdivide on Earth every 10.0s start from the Earth on a journey to the Sun (1.5 x 1011 m away) in a spacecraft moving at 0.850c. How many cells wil exist when the spacecraft crashes into the Sun? Earth time is 588s. Spacecraft time is 310s or 31 cycles of division. 2312.1x 10 cells at the end of the journey. 2. As a spacecraft moving...
The following code does not work. Do you see why? Can you suggest a way to fix it? def length(alist): len = 1 for i in range(len(alist)): len = len + 1 return len print(length([1,2,3]))
python programming: Can you please add comments to describe in detail what the following code does: import os,sys,time sl = [] try: f = open("shopping2.txt","r") for line in f: sl.append(line.strip()) f.close() except: pass def mainScreen(): os.system('cls') # for linux 'clear' print("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%") print(" SHOPPING LIST ") print("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%") print("\n\nYour list contains",len(sl),"items.\n") print("Please choose from the following options:\n") print("(a)dd to the list") print("(d)elete from the list") print("(v)iew the...
I have a problem with my C code. Its suppose to print a random string of length 10 and sometimes it does, but sometimes it prints a shorter string. int main() { int len = 10; char key[len+1]; srand(time(0)); int i; for (i=0; i<len; i++) { key[i] = rand()%256; if (key[i] == EOF || key[i] == '\0'). key[i] = 1; key[i] = '\0'; printf("The generated key is %s\n", key);