Ed added lecture code.
This commit is contained in:
		
							parent
							
								
									a04127d3b2
								
							
						
					
					
						commit
						34966d977b
					
				
					 16 changed files with 445 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -1,2 +1,8 @@
 | 
			
		|||
# 2025spcse160
 | 
			
		||||
# 2025 SP CSE160 Lectures
 | 
			
		||||
 | 
			
		||||
Lecture code from the 2025SP cse160 Python lectures.
 | 
			
		||||
 | 
			
		||||
The directory bigos contains the code for CSE-160-D01 on Tuesday with Edward Bigos.
 | 
			
		||||
 | 
			
		||||
The directory cooper contains the code for CSE-160-D02 distance with Jeff Cooper.
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										18
									
								
								bigos/lecture20250204/circleArea01.py
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								bigos/lecture20250204/circleArea01.py
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,18 @@
 | 
			
		|||
# Program: circleArea01.py
 | 
			
		||||
# Author: Edward Bigos
 | 
			
		||||
# Date: 02/04/2025
 | 
			
		||||
# Overview: Demo program to calculate the area of a rcircle.
 | 
			
		||||
#           No units of measurement are defined.
 | 
			
		||||
import math
 | 
			
		||||
 | 
			
		||||
print("\n\t Program to calculate the area of a circle\n")
 | 
			
		||||
 | 
			
		||||
#PI = 3.1415
 | 
			
		||||
PI = math.pi
 | 
			
		||||
 | 
			
		||||
radius =  float(input("Enter a value for radius:      "))
 | 
			
		||||
 | 
			
		||||
area = PI * radius**2
 | 
			
		||||
 | 
			
		||||
print(f"The area is {area}")
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										1
									
								
								bigos/lecture20250204/demo01.py
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								bigos/lecture20250204/demo01.py
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1 @@
 | 
			
		|||
print("Hello World")
 | 
			
		||||
							
								
								
									
										17
									
								
								bigos/lecture20250204/rectangle01.py
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								bigos/lecture20250204/rectangle01.py
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,17 @@
 | 
			
		|||
# Program: rectangle01.py
 | 
			
		||||
# Author: Edward Bigos
 | 
			
		||||
# Date: 02/04/2025
 | 
			
		||||
# Overview: Demo program to calculate the area of a rectangle.
 | 
			
		||||
#           No units of measurement are defined.
 | 
			
		||||
 | 
			
		||||
print("\n\t Program to calculate the area of a rectangle\n")
 | 
			
		||||
 | 
			
		||||
length = input("Enter a value for the length: ")
 | 
			
		||||
length = float(length)
 | 
			
		||||
 | 
			
		||||
width =  float(input("Enter a value for width:      "))
 | 
			
		||||
 | 
			
		||||
area = length * width
 | 
			
		||||
 | 
			
		||||
print(f"The area is {area}")
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										65
									
								
								bigos/lecture20250211/floats01.py
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										65
									
								
								bigos/lecture20250211/floats01.py
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,65 @@
 | 
			
		|||
 | 
			
		||||
data1 = 6.2
 | 
			
		||||
Data1 = 11.78821988
 | 
			
		||||
DATA1 = 22.
 | 
			
		||||
data1 = 6
 | 
			
		||||
data2 = 4
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
print("-------------Integer addition")
 | 
			
		||||
 | 
			
		||||
result = data1 + data2
 | 
			
		||||
 | 
			
		||||
print("The value of data1 is ",data1)
 | 
			
		||||
print("The value of data2 is ",data2)
 | 
			
		||||
print("The value of result is ",result)
 | 
			
		||||
 | 
			
		||||
print("The type of data1 is ",type(data1) )
 | 
			
		||||
print("The type of data2 is ",type(data2) )
 | 
			
		||||
print("The type of result is ",type(result) )
 | 
			
		||||
 | 
			
		||||
print("-------------Integer subtraction")
 | 
			
		||||
 | 
			
		||||
result = data1 - data2
 | 
			
		||||
 | 
			
		||||
print("The value of data1 is ",data1)
 | 
			
		||||
print("The value of data2 is ",data2)
 | 
			
		||||
print("The value of result is ",result)
 | 
			
		||||
 | 
			
		||||
print("The type of data1 is ",type(data1) )
 | 
			
		||||
print("The type of data2 is ",type(data2) )
 | 
			
		||||
print("The type of result is ",type(result) )
 | 
			
		||||
 | 
			
		||||
print("-------------Integer multiplication")
 | 
			
		||||
 | 
			
		||||
result = data1 * data2
 | 
			
		||||
 | 
			
		||||
print("The value of data1 is ",data1)
 | 
			
		||||
print("The value of data2 is ",data2)
 | 
			
		||||
print("The value of result is ",result)
 | 
			
		||||
 | 
			
		||||
print("The type of data1 is ",type(data1) )
 | 
			
		||||
print("The type of data2 is ",type(data2) )
 | 
			
		||||
print("The type of result is ",type(result) )
 | 
			
		||||
 | 
			
		||||
print("-------------Integer division")
 | 
			
		||||
 | 
			
		||||
result = data1 / data2
 | 
			
		||||
 | 
			
		||||
print("The value of data1 is ",data1)
 | 
			
		||||
print("The value of data2 is ",data2)
 | 
			
		||||
print("The value of result is ",result)
 | 
			
		||||
 | 
			
		||||
print("The type of data1 is ",type(data1) )
 | 
			
		||||
print("The type of data2 is ",type(data2) )
 | 
			
		||||
print("The type of result is ",type(result) )
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
print("The value of data1 is ",data1)
 | 
			
		||||
print("The value of Data1 is ",Data1)
 | 
			
		||||
print("The value of DATA1 is ",DATA1)
 | 
			
		||||
 | 
			
		||||
print("The type of data1 is ",type(data1) )
 | 
			
		||||
print("The type of Data1 is ",type(Data1) )
 | 
			
		||||
print("The type of DATA1 is ",type(DATA1) )
 | 
			
		||||
							
								
								
									
										53
									
								
								bigos/lecture20250211/floats02.py
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										53
									
								
								bigos/lecture20250211/floats02.py
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,53 @@
 | 
			
		|||
 | 
			
		||||
data1 = 6.
 | 
			
		||||
data2 = 4.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
print("-------------Float addition")
 | 
			
		||||
 | 
			
		||||
result = data1 + data2
 | 
			
		||||
 | 
			
		||||
print("The value of data1 is ",data1)
 | 
			
		||||
print("The value of data2 is ",data2)
 | 
			
		||||
print("The value of result is ",result)
 | 
			
		||||
 | 
			
		||||
print("The type of data1 is ",type(data1) )
 | 
			
		||||
print("The type of data2 is ",type(data2) )
 | 
			
		||||
print("The type of result is ",type(result) )
 | 
			
		||||
 | 
			
		||||
print("-------------Float subtraction")
 | 
			
		||||
 | 
			
		||||
result = data1 - data2
 | 
			
		||||
 | 
			
		||||
print("The value of data1 is ",data1)
 | 
			
		||||
print("The value of data2 is ",data2)
 | 
			
		||||
print("The value of result is ",result)
 | 
			
		||||
 | 
			
		||||
print("The type of data1 is ",type(data1) )
 | 
			
		||||
print("The type of data2 is ",type(data2) )
 | 
			
		||||
print("The type of result is ",type(result) )
 | 
			
		||||
 | 
			
		||||
print("-------------Float multiplication")
 | 
			
		||||
 | 
			
		||||
result = data1 * data2
 | 
			
		||||
 | 
			
		||||
print("The value of data1 is ",data1)
 | 
			
		||||
print("The value of data2 is ",data2)
 | 
			
		||||
print("The value of result is ",result)
 | 
			
		||||
 | 
			
		||||
print("The type of data1 is ",type(data1) )
 | 
			
		||||
print("The type of data2 is ",type(data2) )
 | 
			
		||||
print("The type of result is ",type(result) )
 | 
			
		||||
 | 
			
		||||
print("-------------Float division")
 | 
			
		||||
 | 
			
		||||
result = data1 / data2
 | 
			
		||||
 | 
			
		||||
print("The value of data1 is ",data1)
 | 
			
		||||
print("The value of data2 is ",data2)
 | 
			
		||||
print("The value of result is ",result)
 | 
			
		||||
 | 
			
		||||
print("The type of data1 is ",type(data1) )
 | 
			
		||||
print("The type of data2 is ",type(data2) )
 | 
			
		||||
print("The type of result is ",type(result) )
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										18
									
								
								bigos/lecture20250211/inputs01.py
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								bigos/lecture20250211/inputs01.py
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,18 @@
 | 
			
		|||
 | 
			
		||||
data1 = input("Enter a value for data1 ")
 | 
			
		||||
data1 = float(data1)
 | 
			
		||||
 | 
			
		||||
data2 = float( input("Enter a value for data2 ") )
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
print("The value of data1 is ",data1)
 | 
			
		||||
print("The value of data2 is ",data2)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
print("The type of data1 is ",type(data1) )
 | 
			
		||||
print("The type of data2 is ",type(data2) )
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
result = data1 + data2
 | 
			
		||||
 | 
			
		||||
print(result)
 | 
			
		||||
							
								
								
									
										13
									
								
								bigos/lecture20250211/ints01.py
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								bigos/lecture20250211/ints01.py
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,13 @@
 | 
			
		|||
 | 
			
		||||
data1 = 6
 | 
			
		||||
Data1 = 11
 | 
			
		||||
DATA1 = 22
 | 
			
		||||
 | 
			
		||||
print("The value of data1 is ",data1)
 | 
			
		||||
print("The value of Data1 is ",Data1)
 | 
			
		||||
print("The value of DATA1 is ",DATA1)
 | 
			
		||||
 | 
			
		||||
print("The type of data1 is ",type(data1) )
 | 
			
		||||
print("The type of Data1 is ",type(Data1) )
 | 
			
		||||
print("The type of DATA1 is ",type(DATA1) )
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										53
									
								
								bigos/lecture20250211/ints02.py
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										53
									
								
								bigos/lecture20250211/ints02.py
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,53 @@
 | 
			
		|||
 | 
			
		||||
data1 = 6
 | 
			
		||||
data2 = 4
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
print("-------------Integer addition")
 | 
			
		||||
 | 
			
		||||
result = data1 + data2
 | 
			
		||||
 | 
			
		||||
print("The value of data1 is ",data1)
 | 
			
		||||
print("The value of data2 is ",data2)
 | 
			
		||||
print("The value of result is ",result)
 | 
			
		||||
 | 
			
		||||
print("The type of data1 is ",type(data1) )
 | 
			
		||||
print("The type of data2 is ",type(data2) )
 | 
			
		||||
print("The type of result is ",type(result) )
 | 
			
		||||
 | 
			
		||||
print("-------------Integer subtraction")
 | 
			
		||||
 | 
			
		||||
result = data1 - data2
 | 
			
		||||
 | 
			
		||||
print("The value of data1 is ",data1)
 | 
			
		||||
print("The value of data2 is ",data2)
 | 
			
		||||
print("The value of result is ",result)
 | 
			
		||||
 | 
			
		||||
print("The type of data1 is ",type(data1) )
 | 
			
		||||
print("The type of data2 is ",type(data2) )
 | 
			
		||||
print("The type of result is ",type(result) )
 | 
			
		||||
 | 
			
		||||
print("-------------Integer multiplication")
 | 
			
		||||
 | 
			
		||||
result = data1 * data2
 | 
			
		||||
 | 
			
		||||
print("The value of data1 is ",data1)
 | 
			
		||||
print("The value of data2 is ",data2)
 | 
			
		||||
print("The value of result is ",result)
 | 
			
		||||
 | 
			
		||||
print("The type of data1 is ",type(data1) )
 | 
			
		||||
print("The type of data2 is ",type(data2) )
 | 
			
		||||
print("The type of result is ",type(result) )
 | 
			
		||||
 | 
			
		||||
print("-------------Integer division")
 | 
			
		||||
 | 
			
		||||
result = data1 / data2
 | 
			
		||||
 | 
			
		||||
print("The value of data1 is ",data1)
 | 
			
		||||
print("The value of data2 is ",data2)
 | 
			
		||||
print("The value of result is ",result)
 | 
			
		||||
 | 
			
		||||
print("The type of data1 is ",type(data1) )
 | 
			
		||||
print("The type of data2 is ",type(data2) )
 | 
			
		||||
print("The type of result is ",type(result) )
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										53
									
								
								bigos/lecture20250211/mixed01.py
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										53
									
								
								bigos/lecture20250211/mixed01.py
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,53 @@
 | 
			
		|||
 | 
			
		||||
data1 = 6
 | 
			
		||||
data2 = 4.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
print("-------------Float addition")
 | 
			
		||||
 | 
			
		||||
result = data1 + data2
 | 
			
		||||
 | 
			
		||||
print("The value of data1 is ",data1)
 | 
			
		||||
print("The value of data2 is ",data2)
 | 
			
		||||
print("The value of result is ",result)
 | 
			
		||||
 | 
			
		||||
print("The type of data1 is ",type(data1) )
 | 
			
		||||
print("The type of data2 is ",type(data2) )
 | 
			
		||||
print("The type of result is ",type(result) )
 | 
			
		||||
 | 
			
		||||
print("-------------Float subtraction")
 | 
			
		||||
 | 
			
		||||
result = data1 - data2
 | 
			
		||||
 | 
			
		||||
print("The value of data1 is ",data1)
 | 
			
		||||
print("The value of data2 is ",data2)
 | 
			
		||||
print("The value of result is ",result)
 | 
			
		||||
 | 
			
		||||
print("The type of data1 is ",type(data1) )
 | 
			
		||||
print("The type of data2 is ",type(data2) )
 | 
			
		||||
print("The type of result is ",type(result) )
 | 
			
		||||
 | 
			
		||||
print("-------------Float multiplication")
 | 
			
		||||
 | 
			
		||||
result = data1 * data2
 | 
			
		||||
 | 
			
		||||
print("The value of data1 is ",data1)
 | 
			
		||||
print("The value of data2 is ",data2)
 | 
			
		||||
print("The value of result is ",result)
 | 
			
		||||
 | 
			
		||||
print("The type of data1 is ",type(data1) )
 | 
			
		||||
print("The type of data2 is ",type(data2) )
 | 
			
		||||
print("The type of result is ",type(result) )
 | 
			
		||||
 | 
			
		||||
print("-------------Float division")
 | 
			
		||||
 | 
			
		||||
result = data1 / data2
 | 
			
		||||
 | 
			
		||||
print("The value of data1 is ",data1)
 | 
			
		||||
print("The value of data2 is ",data2)
 | 
			
		||||
print("The value of result is ",result)
 | 
			
		||||
 | 
			
		||||
print("The type of data1 is ",type(data1) )
 | 
			
		||||
print("The type of data2 is ",type(data2) )
 | 
			
		||||
print("The type of result is ",type(result) )
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										27
									
								
								bigos/lecture20250211/outputs01.py
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								bigos/lecture20250211/outputs01.py
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,27 @@
 | 
			
		|||
 | 
			
		||||
data1 = input("Enter a value for data1 ")
 | 
			
		||||
data1 = float(data1)
 | 
			
		||||
 | 
			
		||||
data2 = float( input("Enter a value for data2 ") )
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
print("The value of data1 is ",data1)
 | 
			
		||||
print("The value of data2 is ",data2)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
print("The type of data1 is ",type(data1) )
 | 
			
		||||
print("The type of data2 is ",type(data2) )
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
result = data1 + data2
 | 
			
		||||
 | 
			
		||||
print(result)
 | 
			
		||||
 | 
			
		||||
print("The result is ",result)
 | 
			
		||||
# Wrong -- forgot braces
 | 
			
		||||
print(f"The result is result")
 | 
			
		||||
 | 
			
		||||
print(f"The result is {result}")
 | 
			
		||||
print(f"The result is {result:.2f}")
 | 
			
		||||
print(f"The result is ${result:.2f}")
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										24
									
								
								bigos/lecture20250211/strings01.py
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								bigos/lecture20250211/strings01.py
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,24 @@
 | 
			
		|||
 | 
			
		||||
message1 = "This is a sample message string."
 | 
			
		||||
 | 
			
		||||
message2= 'This is another sample message string.'
 | 
			
		||||
 | 
			
		||||
multiLineMessage = '''This is a long paragraph
 | 
			
		||||
of text to
 | 
			
		||||
display
 | 
			
		||||
'''
 | 
			
		||||
 | 
			
		||||
print("message1 ")
 | 
			
		||||
print(type(message1))
 | 
			
		||||
print(message1)
 | 
			
		||||
 | 
			
		||||
print("message2 ")
 | 
			
		||||
print(type(message2))
 | 
			
		||||
print(message2)
 | 
			
		||||
 | 
			
		||||
print("multiLineMessage ")
 | 
			
		||||
print(type(multiLineMessage))
 | 
			
		||||
print(multiLineMessage)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										21
									
								
								bigos/lecture20250211/strings02.py
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								bigos/lecture20250211/strings02.py
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,21 @@
 | 
			
		|||
 | 
			
		||||
message1 = "This is a sample message string."
 | 
			
		||||
 | 
			
		||||
message2= 'This is another sample message string.'
 | 
			
		||||
 | 
			
		||||
multiLineMessage = '''This is a long paragraph
 | 
			
		||||
of text to
 | 
			
		||||
display
 | 
			
		||||
'''
 | 
			
		||||
 | 
			
		||||
print("message1 ")
 | 
			
		||||
print(type(message1), len(message1))
 | 
			
		||||
print(message1)
 | 
			
		||||
 | 
			
		||||
print("message2 ")
 | 
			
		||||
print(type(message2),len(message2))
 | 
			
		||||
print(message2)
 | 
			
		||||
 | 
			
		||||
print("multiLineMessage ")
 | 
			
		||||
print(type(multiLineMessage),len(multiLineMessage))
 | 
			
		||||
print(multiLineMessage)
 | 
			
		||||
							
								
								
									
										53
									
								
								bigos/lecture20250211/strings03.py
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										53
									
								
								bigos/lecture20250211/strings03.py
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,53 @@
 | 
			
		|||
 | 
			
		||||
message1 = "This is a sample message string."
 | 
			
		||||
 | 
			
		||||
message2= 'This is another sample message string.'
 | 
			
		||||
 | 
			
		||||
multiLineMessage = '''This is a long paragraph
 | 
			
		||||
of text to
 | 
			
		||||
display
 | 
			
		||||
'''
 | 
			
		||||
 | 
			
		||||
msg = message1 + message2
 | 
			
		||||
 | 
			
		||||
print("message1 ")
 | 
			
		||||
print(type(message1), len(message1))
 | 
			
		||||
print(message1)
 | 
			
		||||
 | 
			
		||||
print("message2 ")
 | 
			
		||||
print(type(message2),len(message2))
 | 
			
		||||
print(message2)
 | 
			
		||||
 | 
			
		||||
print("msg ")
 | 
			
		||||
print(type(msg),len(msg))
 | 
			
		||||
print(msg)
 | 
			
		||||
 | 
			
		||||
print("\n")
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
msg = message1 * 3
 | 
			
		||||
 | 
			
		||||
print("message1 ")
 | 
			
		||||
print(type(message1), len(message1))
 | 
			
		||||
print(message1)
 | 
			
		||||
 | 
			
		||||
print("message2 ")
 | 
			
		||||
print(type(message2),len(message2))
 | 
			
		||||
print(message2)
 | 
			
		||||
 | 
			
		||||
print("msg ")
 | 
			
		||||
print(type(msg),len(msg))
 | 
			
		||||
print(msg)
 | 
			
		||||
 | 
			
		||||
borderStars = "*" * 60
 | 
			
		||||
print(borderStars)
 | 
			
		||||
 | 
			
		||||
borderMain = "*" + " " * 58 + "*"
 | 
			
		||||
print(borderMain)
 | 
			
		||||
print(borderMain)
 | 
			
		||||
print(borderMain)
 | 
			
		||||
print(borderMain)
 | 
			
		||||
print(borderMain)
 | 
			
		||||
 | 
			
		||||
print(borderStars)
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										22
									
								
								bigos/lecture20250211/strings04.py
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								bigos/lecture20250211/strings04.py
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,22 @@
 | 
			
		|||
 | 
			
		||||
data1 = "6"
 | 
			
		||||
data2 = 4
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
print("The value of data1 is ",data1)
 | 
			
		||||
print("The value of data2 is ",data2)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
print("The type of data1 is ",type(data1) )
 | 
			
		||||
print("The type of data2 is ",type(data2) )
 | 
			
		||||
 | 
			
		||||
# Generates an error
 | 
			
		||||
#result = data1 + data2
 | 
			
		||||
 | 
			
		||||
# Works as long as data1 can be converted to an integer
 | 
			
		||||
result = int(data1) + data2
 | 
			
		||||
 | 
			
		||||
# Works as long as you want string concatenation
 | 
			
		||||
result = data1 + str(data2)
 | 
			
		||||
 | 
			
		||||
print(result)
 | 
			
		||||
							
								
								
									
										0
									
								
								jlcooper/README.md
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								jlcooper/README.md
									
										
									
									
									
										Normal file
									
								
							
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue