Question: Please do not copy others. Thank you Working with data types, boolean expressions & making decisions. Create one .py source file for each task. Tasks

Please do not copy others. Thank you

Working with data types, boolean expressions & making decisions.

Create one .py source file for each task.

Tasks

Task 1

1) Create 4 variables with four distinct data types and values

2) Output each variable using one output statement

Task 2

1) Ask the user for 3 text values

2) Determine which text is the longest

a) Output both the length and the value of the longest text (1 mark)

i) Hint: There are 7 possibilities

Task 3

1) Ask the user for input. (1 mark)

2) Determine if the user input is a number

a) If so,

i) Typecast the input to a numerical data type.

ii) Output the number

b) If not,

i) Output the number of characters of the user input

Task 4

1) Ask user for input

2) Using one IF statement block

a) Determine if input is

i) a string greater than 3 characters

(1) Display a message stating that the string is greater than 3 characters

ii) an empty string

(1) Display a message stating that the string is empty

b) If neither of the above cases are true, display a message thanking the user for input.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!