File tree Expand file tree Collapse file tree 3 files changed +23
-0
lines changed Expand file tree Collapse file tree 3 files changed +23
-0
lines changed Original file line number Diff line number Diff line change
1
+ print("Hello World")
2
+ name=input("Please enter Your Name: ")
3
+ print("hello",name)
Original file line number Diff line number Diff line change
1
+ # Imagine a right triangle:
2
+
3
+ # Read a number from the standard input and assign it to a
4
+ # Read another number from the standard input and assign it to b
5
+ # Use Pythagoras theorem to determine the value of the long side c
6
+ # Use string formatting to print out the length of the long side
7
+ # If c is larger than PI (a constant), also print out: And this is longer than PI
8
+ pi=3.14
9
+ a=float(input("input the value of side a"))
10
+ b=float(input("input the value of side b"))
11
+ c=(a**2+b**2)**0.5
12
+ print("the length of c is:",c)
13
+ if c>pi:
14
+ print("and is longer than pi")
15
+
Original file line number Diff line number Diff line change
1
+ # print hello world
2
+ print (" Hello World" )
3
+ # write code that asks the user to enter his/her name and print hello, username
4
+ name = input ("Please enter your name" )
5
+ print ("hello" ,name )
You can’t perform that action at this time.
0 commit comments