Numeric Data and Operators
✕Numeric Data
Question 1 of 4
- Display their data types
- Display their sum
- Display their difference
- Display their product
- Display their division
- Convert both
num_1andnum_2into string and display sum again - Repeat above exercise but with storing both variables with a
complex number - Create variable
num_3as15andnum_4as4. Swap their values and display the result
Create two variablesnum_1as7,num_2as3.5and:Assignment Operators
Question 2 of 4
- Assign
mark_1,mark_2,mark_3with value78,85,92. Calculate total and average mark - Add
5toweight_1and reassign toweight_1 - Subtract
10fromweight_2and reassign toweight_2 - Multiply
weight_3by1.1and reassign toweight_3 - Divide
weight_4by2and reassign toweight_4 - Assign variable
my_numas15. Find remainder when divided by2as reassign to itself - Find the value when
1.1is raised to the power of3i.e.1.1 ^ 3. Assign is toresult
Assignweight_1,weight_2,weight_3,weight_4all having value as70- Assign
Comparison & Logical Operators
Question 3 of 4
- Check if your age 16
- Check if your age is not 70
- Check if you are a child (
age less than 13) - Check if you are an adult (
age 20 or above) - Check if you are eligible to vote (
18+ can vote) - Check if you are a teenager (
age between 13 and 19) - Check if you lie on passive population (
below 5 and over 65 considered passive) - Check if you are eligible for driving license (
age between 18 and 65)
Assign your age to variablemy_ageand:Membership Operators
Question 4 of 4
- Letter
ais in your name - Letter
ais not in your name - Movie
Avataris in your collection - Movie
Avataris not in your collection - Repeat exercise 2 but creating
movie_collectionas atuple - Repeat exercise 2 but creating
movie_collectionas aset
Assign variablemy_nameas your name and check if:Assign variablemovie_collectionas a list of your favorite movies and check if:- Letter
