Question: Open the script exercise1.py present inside the project folder 2. To run the script, open terminal and execute the following command: ``` python3 exercise1.py ```

Open the script exercise1.py present inside the project folder

2. To run the script, open terminal and execute the following command: ``` python3 exercise1.py ``` 3.

Step 3: Fix the script so the variables have the correct type.

Code in Python:

# Using explicit type conversion, change the following

# inputs so the types match with the following below

#

# name = type string

# age = type int

# height = type float

# loyalty = type boolean

# Modify the line below

name = input('What is your name? ')

print(f"Type of name variable is: {str(name)}. It should be ")

# Modify the line below

age = input('What is your age? ')

print(f"Type of age variable is: {int(age)}. It should be ")

# Modify the line below

height = input('What is your height in meters? ')

print(f"Type of height variable is: {float(height)}. It should be ")

# Modify the line below

loyalty = input('Are you part of our loyalty program? ')

print(f"Type of loyalty variable is: {bool(loyalty)}. It should be ")

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!