#2: Portrait taller than wide & landscape wider than tall
Answer:
Replace /* Your solution goes here */ with:
<em>System.out.println(randGen.nextInt(49) + 100);</em>
<em>System.out.println(randGen.nextInt(49) + 100);</em>
<em />
Explanation:
Required
Statements to print two random numbers between 100 and 149 (both inclusive)
First, the random numbers must be generated. From the template given, the random object, randGen, has been created.
The syntax to then follow to generate between the interval is:
<em>randGen.nextInt(high-low) + low;</em>
Where:
high = 149 and low = 100
So, the statement becomes:
<em>randGen.nextInt(149 - 100) + 100;</em>
<em>randGen.nextInt(49) + 100;</em>
<em />
Lastly, print the statements:
<em>System.out.println(randGen.nextInt(49) + 100);</em>
<em>System.out.println(randGen.nextInt(49) + 100);</em>
<em />
Answer:
The modified program is as follows:
user_input = input()
short_names = list(user_input.split(" "))
short_names.pop(0)
short_names[-1] = "Joe"
print(short_names)
Explanation:
This gets the user input
user_input = input()
This converts input to list
short_names = list(user_input.split(" "))
This removes the first item of the list
short_names.pop(0)
This updates the last item to "Joe"
short_names[-1] = "Joe"
This prints the updated list
print(short_names)
Explanation:
Generic Android Device means the Android devices which does not any specific brand name or they can not be related to any specific class or brand. For ex: Samsung developed Epic 4g Touch Android device but they later removed lot of fancy features and stuffs from it launched with Galaxy S.