Session 1 - Basic Inputs Flashcards

Basics – Inputs and Operations (15 cards)

1
Q

Simple print (2mins)

Write a program that prints
Hello, Python!

A

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

User Input (2mins)

Ask the user for his name and print the name as below. The “Eran” should be changed as to whatever name the user has entered.

Input: Eran

Output:
Hello, Eran!

A

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Sum (2mins)

Ask the user for two numbers and print their sum.

Input 1: 15
Input 2: 5

Output:
The sum is: 20

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Difference (2mins)

Ask the user for two numbers and print their difference.

Input 1: 2
Input 2: 4

Output:
The difference is: -2

A

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Product (2mins)

Ask the user for two numbers and print their product.

Input 1: 2
Input 2: 4

Output:
The product is: 8

A

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Quotient (2mins)

Ask the user for two numbers and print their quotient.

Input 1: 10
Input 2: 2

Output:
The quotient is: 5

A

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Basic Math (2mins)

Ask the user for three numbers. The first number should be added to the second number. The sum of the two numbers should then be multiplied to the third number

Input 1: 2
Input 2: 4
Input 3: 6

Output:
The answer is: 36

A

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Odd or Even (2mins)

Ask the user for two numbers. Get the sum of the two numbers then check whether the sum is odd or even.

Input 1: 6
Input 2: 5

Output:
The sum is: odd

A

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Ohm’s Law (2mins)

Ask the user for two numbers. The first number will be the resistance while the second number is the current. Print the voltage calculated.

Input 1: 10
Input 2: 5

Output:
The voltage is: 50

A

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Positive, Negative, or Zero (2mins)

Ask the user for a number and print whether it’s positive, negative, or zero.

Input 1: Enter a number: -5

Output:
Negative number

A

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Check Voting Eligibility (2mins)

Ask the user for age and check if they’re eligible to vote (18+).

Input 1: Enter your age: 16

Output:
Not eligible to vote

A

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Find the Largest of Two Numbers (2mins)

Compare two numbers and print which one is larger.

Input 1: Enter first number: 12
Input 2: Enter second number: 7

Output:
12 is larger

A

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Grade Checker (2mins)

Ask the user for a mark (0–100) and print the grade.
Grading Rules:
* A: 90–100
* B: 80–89
* C: 70–79
* D: 60–69
* F: Below 60

Input 1: Enter your mark: 82

Output:
Grade: B

A

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Matrix Sum (4mins)

Ask the user for two sets of numbers separated by spaces then print the matrix sum of those numbers.
Input 1: 2 5 15 10 12
Input 2: 4 -7 6 11 -2

Output:
6 -2 21 21 10

A

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Matrix Difference (4mins)

Ask the user for two sets of numbers separated by spaces then print the matrix difference of those numbers.
Input 1: 2 5 15 10 12
Input 2: 4 -7 6 11 -2

Output:
-2 12 9 -1 14

A

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly