# -*- coding: utf-8 -*- """ Created on Mon Sep 5 11:09:24 2022 @author: cpresser """ number1 = "4.5" # input("Enter a number: ") number2 = "5" # input("Enter a number: ") #convert the string to a float (real number) n1 = float(number1) n2 = int(number2) #convert to integer print(number1 + number2) print(n1 + n2) # Loops: repeat portions of code n = 1 #1. Initialization: start value #2. Continue condition: keep going as long as the # condition is true while n <= 10: #repeat as long as n is less than 11 print(f"{n} Hi") n = n + 1 #3 Step: change toward making the # condition false print("Done\nNext One\n") #Rewrite so the loop counts down from 10 to 1 n = 10 while n >= 1: print(f"{n} Hi") n = n - 1 print("Done\n") n = 1 sum = 0 # sum of integers 1..100 while n <= 100: sum = sum + n n = n + 1 print(sum)