Posts

Showing posts from May, 2024

Module 3 4930

Daniel Tafmizi Dr. Friedman Lis 4930 May 27, 2024 Module 3 # 1: Write a function that takes in a person's name, and prints out a greeting. # list of friends friends = [ "John" , "Michael" , "Oliver" ] # list of greetings greetings = [ "hello [friend], how are you doing." , "Hows the weather treating you [friend]." , "How ya been [friend]." ] # goes through greetings for x in greetings: # goes through friends for y in friends: #replaces [friend] with friends (y) final = x.replace( "[friend]" , y) print (final) # 2: Full name function #function that accepts two objects def full_name (x,y): #Formats result by stripping white space on either end and creates greeting print ( "Hello, " + str .strip(x) + " " + str .strip(y)) full_name( "Daniel" , "Tafmizi" ) full_name( " Doctor " , " Friedman" ) full_name( "Abraha

Module 2 4930

 Daniel Tafmizi Dr. Friedman Lis 4930 May 27, 2024 Module 2 Assignment:  print ( 'Hello World' ) Hello World String1 = 'Welcome to the Geeks World' print ( "String with the use of Single Quotes: " ) print (String1) String with the use of Single Quotes: Welcome to the Geeks World It seems that the print and string functions work seamlessly. The string function offers a "playground" for modification and structuring. The print function allows the user to use the string in their program. The example above shows a simple use case. String1 holds a string, that is later called in the program. More advanced uses of this can begin handling user data or allow for manipulation techniques. Notes: Run python in cmd - I did not run into much trouble. Initially, I could not link the script file to the cmd. I tried typing "python3" and it directed me to a Microsoft store download. After downloading the MS python, I was able to type "python3" and