Answer:
A. dict = {‘Name’: ‘Matthew’, ‘Age’: 14, ‘School’: ‘ABC School’}
Explanation:
Since <em>python does not use type when declaring a variable</em>, you must make sure you make your variables correctly or else it won't compile correctly. Lists use braces[]; Strings use quotes, "" or ''; Integers are just declared with a number(s); Dictionaries use brackets{} and inside are <u>attributes of something</u>. For instance, you can use dictionaries to describe ages, {'"Bryan": 6, "Alex": 13, etc.} <u>Sort of like a json file</u>. Dictionaries also tend to use <u>uppercase letters</u> when describing something. The only answer that has all the attributes correct is A. dict = {‘Name’: ‘Matthew’, ‘Age’: 14, ‘School’: ‘ABC School’}
hope i helped :D
Using/driving with an electric car or using car that is ecologically friendly (less pollution) Ex.Bio Fuel
Answer:
import java.util.Scanner;
public class HollowSquare
{
public static void main(String args[])
{
Scanner scan = new Scanner(System.in);
int size;
System.out.print("Enter the size : ");
size = scan.nextInt();
if(size>=1 && size<=20)
{
for(int i=0; i<size; i++)
{
for(int j=0; j<size; j++)
{
if(i==0 || j==0 || i==size-1 || j==size-1)
System.out.print("*");
else
System.out.print(" ");
}
System.out.println();
}
}
else
System.out.println("Invalid size.");
}
}
Answer:
1)
n = int(input("Please enter the length of the sequence: "))
print("Please enter your sequence")
product = 1
for i in range(n):
val = int(input())
product *= val
print("The geometric mean is: %.4f"%pow(product,1/n))
2)
print("Please enter a non-empty sequence of positive integers, each one is in a separate line. End your sequence by typing done:")
product = 1
val = input()
n = 0
while(val!="done"):
product *= int(val)
n += 1
val = input()
print("The geometric mean is: %.4f"%pow(product,1/n))
Explanation: