Giter Site home page Giter Site logo

charleenchy / task3 Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 2 KB

TASK 3 Write a Python program to find those numbers which are divisible by 7 and multiple of 5, between 1500 and 2700 (both included). Write a Python program to convert temperatures to and from celsius, fahrenheit. Write a Python program to guess a number between 1 to 9. Note : User is prompted to enter a guess. If the user guesses wrong then the prompt appears again until the guess is correct, on successful guess, user will get a "Well guessed!" message, and the program will exit. Write a Python program to check the validity of password input by users. Validation. Write a Python program to sum of two given integers. However, if the sum is between 15 to 20 it will return 20 #30daysofcodingwithpython

Python 100.00%

task3's Introduction

Task3

#Write a Python program to find those numbers which are divisible by 7 and multiple of 5, between 1500 and 2700 (both included) for k in range(1500,2701): if(k%7==0 and k%5==0): print(k)

#Write a Python program to convert temperatures to and from celsius, fahrenheit ans=int(input("1 for cel to Fah, 2 for Fah to cel")) If ans == 1: cel = int(input("enter a temp in cel")) fah = (cel - 9/5) + 32 print('%.2f Celsius is: %.2f Fahrenheit' %(cel, fah)) else: fah = int(input("yourtemp in Fah")) cel = (fah - 32) * 5/9 print('%.2f Fahrenheit is: %.2f Celsius' %(fah, cel))

#Write a Python program to guess a number between 1 to 9 import random target_num, pick_num = random.randint(1, 10), 0 while target_num != pick_num: pick_num = int(input('Guess a number between 1 and 10 until you get it right : ')) print('Correct Guess!')

#Write a Python program to check the validity of password input by users import re z= input("Set Password ") x = True while x: if (len(z)<6 or len(z)>12): break elif not re.search("[a-z]",z): break elif not re.search("[0-9]",z): break elif not re.search("[A-Z]",z): break elif not re.search("[$#@]",z): break elif re.search("\s",z): break else: print("valid password") x=False break if x: print("Not a Valid Password")

#Write a Python program to sum of two given integers. However, if the sum is between 15 to 20 it will return 20
a = int(input("enter a number:")) b = int(input("enter another number:")) x = a + b if x >= 15 and x <= 20: print(20) else: print (x)

task3's People

Contributors

charleenchy avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.