From f9da2a599597fb40d59acdac069087fe4c3c68a4 Mon Sep 17 00:00:00 2001 From: sandesht45 <64426190+sandesht45@users.noreply.github.com> Date: Mon, 25 May 2020 21:03:17 +0530 Subject: [PATCH] Add files via upload --- calculator.py | 7 +++++++ center.py | 2 ++ escape.py | 4 ++++ exercizethreeinp.py | 3 +++ hello123.py | 1 + intfun.py | 4 ++++ multiplevariables.py | 4 ++++ newfile.py | 1 + slicing.py | 3 +++ strformatting.py | 4 ++++ strings.py | 4 ++++ twoinp_21.py | 2 ++ userinput.py | 5 +++++ variable.py | 4 ++++ 14 files changed, 48 insertions(+) create mode 100644 calculator.py create mode 100644 center.py create mode 100644 escape.py create mode 100644 exercizethreeinp.py create mode 100644 hello123.py create mode 100644 intfun.py create mode 100644 multiplevariables.py create mode 100644 newfile.py create mode 100644 slicing.py create mode 100644 strformatting.py create mode 100644 strings.py create mode 100644 twoinp_21.py create mode 100644 userinput.py create mode 100644 variable.py diff --git a/calculator.py b/calculator.py new file mode 100644 index 0000000..1bf6592 --- /dev/null +++ b/calculator.py @@ -0,0 +1,7 @@ +print(2/4) #floating point division +print(4/2) +print(4//2) #Integer Division +print(2**3) #for Exponent Values +print(2**0.5) #for Square root Values +print(round(2**0.5,2)) +print(round(2**0.5,4)) \ No newline at end of file diff --git a/center.py b/center.py new file mode 100644 index 0000000..b324764 --- /dev/null +++ b/center.py @@ -0,0 +1,2 @@ +name,char,times=input("Enter name and char\n").split( ) +print(name.center(len(name)+int(times),char)) \ No newline at end of file diff --git a/escape.py b/escape.py new file mode 100644 index 0000000..f3fb8d1 --- /dev/null +++ b/escape.py @@ -0,0 +1,4 @@ +print('this is \\\\ double backslash') +print('these are /\/\/\/\/\ mountains') +print('he is \t awesome') +print('\\\" \\n \\t \\\'') \ No newline at end of file diff --git a/exercizethreeinp.py b/exercizethreeinp.py new file mode 100644 index 0000000..9aff663 --- /dev/null +++ b/exercizethreeinp.py @@ -0,0 +1,3 @@ +num1,num2,num3=input("Enter three numbers").split( ) +avg=(int(num1)+int(num2)+int(num3)) / 3 +print(f"Average of three numbers is {avg}") \ No newline at end of file diff --git a/hello123.py b/hello123.py new file mode 100644 index 0000000..7821258 --- /dev/null +++ b/hello123.py @@ -0,0 +1 @@ +print('Hello Sandesh') \ No newline at end of file diff --git a/intfun.py b/intfun.py new file mode 100644 index 0000000..b1f0720 --- /dev/null +++ b/intfun.py @@ -0,0 +1,4 @@ +n1=int(input("Enter first No ")) #5 +n2=int(input("Enter second No")) #5 +total=n1+n2 #10 +print("Total is"+" "+str(total)) \ No newline at end of file diff --git a/multiplevariables.py b/multiplevariables.py new file mode 100644 index 0000000..872e8ef --- /dev/null +++ b/multiplevariables.py @@ -0,0 +1,4 @@ +name,age="Sandesh","21" +print("Hello " + name + " Your age is " + age ) +x=y=z=1 +print(x+y+z) diff --git a/newfile.py b/newfile.py new file mode 100644 index 0000000..220d2f1 --- /dev/null +++ b/newfile.py @@ -0,0 +1 @@ +print('Sandesh') \ No newline at end of file diff --git a/slicing.py b/slicing.py new file mode 100644 index 0000000..ccdab2d --- /dev/null +++ b/slicing.py @@ -0,0 +1,3 @@ +name,letter=input("Enter name and letter").split( ) +print(len(name)) +print(name.count(letter)) \ No newline at end of file diff --git a/strformatting.py b/strformatting.py new file mode 100644 index 0000000..6bbd0b4 --- /dev/null +++ b/strformatting.py @@ -0,0 +1,4 @@ +name= "sandesh" +age=21 +print("hello {} your age is {}".format(name,age)) +print(f"hello {name} your age is{age}") \ No newline at end of file diff --git a/strings.py b/strings.py new file mode 100644 index 0000000..a431591 --- /dev/null +++ b/strings.py @@ -0,0 +1,4 @@ +first_Name= "Sandesh" +last_Name="Tayde" +Full_Name = first_Name +" " +last_Name +print(Full_Name) \ No newline at end of file diff --git a/twoinp_21.py b/twoinp_21.py new file mode 100644 index 0000000..090a60e --- /dev/null +++ b/twoinp_21.py @@ -0,0 +1,2 @@ +name,age=input("Enter Your Name and age ").split(",")ls +print(name +" "+ age) \ No newline at end of file diff --git a/userinput.py b/userinput.py new file mode 100644 index 0000000..04c6dd9 --- /dev/null +++ b/userinput.py @@ -0,0 +1,5 @@ +name= input("Please Enter Your Name here" ) +print("Hello"+ name) +age=input("What is your age") +print("Your Age is" + age) + diff --git a/variable.py b/variable.py new file mode 100644 index 0000000..2ae4974 --- /dev/null +++ b/variable.py @@ -0,0 +1,4 @@ +number1=2 +print(number1) +number1=4 +print(number1) \ No newline at end of file