From 9357b35b4410d2b94d6bc9b47e35d2aa2a113c1b Mon Sep 17 00:00:00 2001 From: Spencerscooper Date: Mon, 10 Jul 2023 04:50:24 +0000 Subject: [PATCH] firstprog.py --- Summer-Time-W-Jeff/.firstprog.py.swp | Bin 0 -> 1024 bytes Summer-Time-W-Jeff/firstprog.py | 36 +++++++++++++++++++++++++++ Summer-Time-W-Jeff/randomNumber.py | 10 ++++++++ 3 files changed, 46 insertions(+) create mode 100644 Summer-Time-W-Jeff/.firstprog.py.swp create mode 100644 Summer-Time-W-Jeff/firstprog.py create mode 100644 Summer-Time-W-Jeff/randomNumber.py diff --git a/Summer-Time-W-Jeff/.firstprog.py.swp b/Summer-Time-W-Jeff/.firstprog.py.swp new file mode 100644 index 0000000000000000000000000000000000000000..a907339a39690acb25c34153bcb512421b917f6c GIT binary patch literal 1024 zcmYc?$V<%2S1{ExVL$-}oD2-bmBooExtVz=5?DCJ$@%#OsYO_1P=(Smi;7DMit^L- V3Mx@$MtP$lFd71M2!T*^I{>Of4&DF& literal 0 HcmV?d00001 diff --git a/Summer-Time-W-Jeff/firstprog.py b/Summer-Time-W-Jeff/firstprog.py new file mode 100644 index 0000000..2130a96 --- /dev/null +++ b/Summer-Time-W-Jeff/firstprog.py @@ -0,0 +1,36 @@ +#from gasp import * +from random import randint + +'''Challenge write the following program +in a file named firstprog.py''' + +print("Experiment 1; ") +print( 1+2) +"How come this did not print" +print("but this did") +print() +print() + +print("Experiment 2:") +for number in 2,4,6: + print(2 * number) + +for number in 2,4,6: + print(3* number, end="") + +'''When you place an expression on a line in python script without the print +function that expression will not get excute. +Putting comma " , " at the end stop the print function from creating a newline. + +So far so good in this first lecture on introduction to Python which is a programming +language I learn that print is a build in function that is use to display output +to the user''' + +'''begin_graphics() + +Line((100,100), (200, 200)) +Circle((320, 240), 40) +Box((400, 300), 100, 85)''' + + + diff --git a/Summer-Time-W-Jeff/randomNumber.py b/Summer-Time-W-Jeff/randomNumber.py new file mode 100644 index 0000000..74a2427 --- /dev/null +++ b/Summer-Time-W-Jeff/randomNumber.py @@ -0,0 +1,10 @@ +from random import randint +number1 = input (str("Enter two number to know it sum\n")) +number2 = input (str("\n")) +print( int(number1) + int(number2)) + +randint (2,16) +first_input = input(str("What is 8 time 2")) +second_input = input (str("")) +print(int (first_input) * int(second_input)) +