Created
August 17, 2022 17:14
-
-
Save NotoriousArnav/fa205ddeb640a9c6c9b1ff0dc8936c4f to your computer and use it in GitHub Desktop.
test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
greetings=["Namaste", "Hola", "Hello", "Hi", "Subheccha", "Wenhou", "Konichiwa", "annyeonghasibnikka"] | |
name = input("Enter Your Name: ") | |
print(random.choice(greetings), name, sep=" ") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user_float = float(input("enter any number: ")) | |
if user_float==0: | |
print("Zero") | |
elif user_float>0: | |
print("+ve") | |
else: | |
print("-ve") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Goal: To get Square and Square root of any number given by user | |
num= float(input ("Enter a number ")) | |
sq=num*num | |
sqrt=num **(1/2) | |
print (f"your square of the given is {sq} and square root is {sqrt}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment