Exercise

The target of this exercise is to create a string, an integer, and a floating point number. The string should be named mystring and should contain the word “hello”. The floating point number should be named myfloat and should contain the number 10.0, and the integer should be named myint and should contain the number 20.

# code already changed here.
mystring = "hello"
myfloat = 10.0
myint = 20

# testing code
if mystring == "hello":
    print("String: %s" % mystring)
if isinstance(myfloat, float) and myfloat == 10.0:
    print("Float: %f" % myfloat)
if isinstance(myint, int) and myint == 20:
    print("Integer: %d" % myint)

Trinket.io on-line Python compiler

 

Related Videos:

MiltonMarketing.com Related Videos.

Related Post:

Learn Multiple Function Arguments in Python

Python Basic String Operations

Learn about programming Functions in Python

Learn Code Introspection Python Programming

Learn Pandas Basics Python tabular data manipulation

Introduction to Python Programming Language

Learn about Python Sets (lists)

Learn about Dictionaries datatype for Python

Python Basic Operators

Comparing Python to other languages

Learn about Numpy Arrays in Python programming