Difference between revisions of "User:Praveer-mathur-9f3d@uni-bonn.de"

From HPC Wiki
Jump to navigation Jump to search
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
=== Quiz === <!--T:5-->   
+
=== Short Quiz: Variable Assignment === <!--T:5-->   
 +
 
 +
What values do the two variables "mass" and "age" have in the following lines?
 +
 
 +
{{hidden begin
 +
|title = <code>mass = 47.5 <br> print(mass)</code>
 +
}}
 +
<quiz display=simple>
 +
{
 +
|type="()"}
 +
+  Click and submit to see the answer
 +
|| <code>47.5</code>
 +
</quiz>
 +
{{hidden end}}
 +
 
 +
{{hidden begin
 +
|title = <code>age = 122 <br> print(mass, age)</code>
 +
}}
 +
<quiz display=simple>
 +
{
 +
|type="()"}
 +
+  Click and submit to see the answer
 +
|| <code>47.5 122</code>
 +
</quiz>
 +
{{hidden end}}
 +
 
 +
{{hidden begin
 +
|title = <code>mass = mass * 2.0 <br> print(mass, age)</code>
 +
}}
 +
<quiz display=simple>
 +
{
 +
|type="()"}
 +
+  Click and submit to see the answer
 +
|| <code>95.0 122</code>
 +
</quiz>
 +
{{hidden end}}
 +
 
 +
{{hidden begin
 +
|title = <code>age = age - 20 <br> print(mass, age)</code>
 +
}}
 +
<quiz display=simple>
 +
{
 +
|type="()"}
 +
+  Click and submit to see the answer
 +
|| <code>95.0 102</code>
 +
</quiz>
 +
{{hidden end}}
 +
 
 +
=== Short Quiz: Data Types === <!--T:5-->
 +
 
 +
{{hidden begin
 +
|title = <code>planet = 'Earth'</code> <br> What datatype does the variable planet have?
 +
}}
 +
<quiz display=simple>
 +
{
 +
|type="()"}
 +
- Integer
 +
|| Explanation: Wrong
 +
+ String
 +
|| Explanation: Correct
 +
- Boolean
 +
|| Explanation: Wrong
 +
- Float
 +
|| Explanation: Wrong
 +
</quiz>
 +
{{hidden end}}
  
 
{{hidden begin  
 
{{hidden begin  
|title = 1. What is the POSIX Standard?
+
|title = <code>apples = 5</code> <br> What datatype does the variable apples have?
 
}}
 
}}
 
<quiz display=simple>
 
<quiz display=simple>
 
{
 
{
 
|type="()"}
 
|type="()"}
+ A standard describing interfaces that all complicant variants of UNIX need to implement.
+
- Integer
|| True
+
|| Explanation: Correct
- A proposal for a new operating system succeeding UNIX.
+
+ String
|| The POSIX standard is not a specific implementation, but rather a standardized interface.
+
|| Explanation: Wrong
- A UNIX distribution that had to be renamed due to legal claims.
+
- Boolean
|| The POSIX standard is not a specific implementation, but rather a standardized interface.
+
|| Explanation: Wrong
 +
- Float
 +
|| Explanation: Wrong
 
</quiz>
 
</quiz>
 
{{hidden end}}
 
{{hidden end}}
  
 
{{hidden begin  
 
{{hidden begin  
|title = 2. What does Linux refer to?
+
|title = <code>distance = 10.5</code> <br> What datatype does the variable distance have?
 
}}
 
}}
 
<quiz display=simple>
 
<quiz display=simple>
 
{
 
{
 
|type="()"}
 
|type="()"}
- A complete installation of the operating system with all supporting tools and applications. 
+
- Integer
|| Linux only refers to the kernel only. System application may be developed for Linux but they are not part of Linux itself.
+
|| Explanation: Wrong
+ The operating system kernel only.
+
+ String
|| Linux only refers to the kernel only. System application may be developed for Linux but they are not part of Linux itself.
+
|| Explanation: Wrong
- The operating sytem kernel including the most basic system tools.
+
- Boolean
|| Linux only refers to the kernel only. System application may be developed for Linux but they are not part of Linux itself.
+
|| Explanation: Wrong
 +
- Float
 +
|| Explanation: Correct
 
</quiz>
 
</quiz>
 
{{hidden end}}
 
{{hidden end}}
  
 
{{hidden begin  
 
{{hidden begin  
|title = 3. What is a distribution?
+
|title = <code>false = 7 > 2</code> <br> What datatype does the variable false have?
 
}}
 
}}
 
<quiz display=simple>
 
<quiz display=simple>
 
{
 
{
 
|type="()"}
 
|type="()"}
- A commercial publishing channel to obtain the Linux kernel. 
+
- Integer
||  
+
|| Explanation: Wrong
+ A pre-configured collection of Linux kernel and accompanying applications.
+
+ String
||  
+
|| Explanation: Wrong
- A public file server hosting the Linux kernel and a few system applications.
+
- Boolean
||
+
|| Explanation: Correct
- None of the Above
+
- Float
||  
+
|| Explanation: Wrong
 
</quiz>
 
</quiz>
 
{{hidden end}}
 
{{hidden end}}
           
+
 
 +
=== Short Quiz: Boolean Operations === <!--T:5-->
 +
 
 +
<code>var1 = True <br> var2 = False</code>
 +
What is the value of each variable after each of the following print statements?
 +
 
 
{{hidden begin  
 
{{hidden begin  
|title = 4. What does GNU stands for?
+
|title = <code>print(var1, var2)</code>
 
}}
 
}}
 
<quiz display=simple>
 
<quiz display=simple>
 
{
 
{
 
|type="()"}
 
|type="()"}
GNU's Not Unix
+
Click and submit to see the answer
|| True
+
|| <code>True False</code>
-  Geek Needed Unix
 
||
 
-  General Unix
 
||
 
-  None of the Above
 
||
 
 
</quiz>
 
</quiz>
 
{{hidden end}}
 
{{hidden end}}
  
{{hidden begin
+
{{hidden begin  
|title = 5. How many HPC systems of the Top500 used some form of Linux in June of 2020?
+
|title = <code>var2 = var1 or var2 <br> print(var1, var2)</code>
 +
}}
 +
<quiz display=simple>
 +
{
 +
|type="()"}
 +
+  Click and submit to see the answer
 +
|| <code>True True</code>
 +
</quiz>
 +
{{hidden end}}
 +
 
 +
{{hidden begin
 +
|title = <code>var1 = var1 and not var2 <br> print(var1, var2)/code>
 +
}}
 +
<quiz display=simple>
 +
{
 +
|type="()"}
 +
+  Click and submit to see the answer
 +
|| <code>False True</code>
 +
</quiz>
 +
{{hidden end}}
 +
 
 +
{{hidden begin
 +
|title = <code>var1 = not(var1 and not var1) <br> print(var1, var2)</code>
 
}}
 
}}
 
<quiz display=simple>
 
<quiz display=simple>
 
{
 
{
 
|type="()"}
 
|type="()"}
- 80%
+
+  Click and submit to see the answer
|| see [https://top500.org/statistics/list top500] (access on 27.08.2020) List in June 2020 shows all Top 500 supercomputers are using Linux.
+
|| <code>True True</code>
- 95%
 
|| see [https://top500.org/statistics/list top500] (access on 27.08.2020) List in June 2020 shows all Top 500 supercomputers are using Linux.
 
+ 100%
 
|| see [https://top500.org/statistics/list top500] (access on 27.08.2020) List in June 2020 shows all Top 500 supercomputers are using Linux.
 
 
</quiz>
 
</quiz>
 
{{hidden end}}
 
{{hidden end}}

Latest revision as of 14:21, 6 March 2026

Short Quiz: Variable Assignment

What values do the two variables "mass" and "age" have in the following lines?

mass = 47.5
print(mass)

Click and submit to see the answer

age = 122
print(mass, age)

Click and submit to see the answer

mass = mass * 2.0
print(mass, age)

Click and submit to see the answer

age = age - 20
print(mass, age)

Click and submit to see the answer

Short Quiz: Data Types

planet = 'Earth'
What datatype does the variable planet have?

Integer
String
Boolean
Float

apples = 5
What datatype does the variable apples have?

Integer
String
Boolean
Float

distance = 10.5
What datatype does the variable distance have?

Integer
String
Boolean
Float

false = 7 > 2
What datatype does the variable false have?

Integer
String
Boolean
Float

Short Quiz: Boolean Operations

var1 = True
var2 = False
What is the value of each variable after each of the following print statements?

print(var1, var2)

Click and submit to see the answer

var2 = var1 or var2
print(var1, var2)

Click and submit to see the answer

var1 = var1 and not var2
print(var1, var2)/code>

Click and submit to see the answer

var1 = not(var1 and not var1)
print(var1, var2)

Click and submit to see the answer