Вы находитесь на странице: 1из 3

1.

#print(4 * (6 + 5))

#print(4 * 6 + 5)

#print(4 + 6 * 5)

#print(3 + 1.5 + 4)

3. x=int(input("Enter the value:"))

num_sqrt = x ** 0.5

print('The square root of %0.3f is %0.3f'%(x ,num_sqrt))

print("The Square value is:",x*x)

4. x="hello"

print(x[1])

5.x="helloo"

print(x[1:3])

6. x="hello"

print(x[-1])

7. string = input("Please enter your own String : ")


if(string == string[:: - 1]):
print("This is a Palindrome String")
else:
print("This is Not a Palindrome String")

8. c=input("Enter the string:")


f=len(c)
print(f)
if(f%2==0):
print("the word is even")
else:
print("The word is odd")
9.

10. import sys

user1 = input("What's your name?")


user2 = input("And your name?")
user1_answer = input("%s, do yo want to choose rock, paper or scissors?" % user1)
user2_answer = input("%s, do you want to choose rock, paper or scissors?" % user2)

def compare(u1, u2):


if u1 == u2:
return("It's a tie!")
elif u1 == 'rock':
if u2 == 'scissors':
return("Rock wins!")
else:
return("Paper wins!")
elif u1 == 'scissors':
if u2 == 'paper':
return("Scissors win!")
else:
return("Rock wins!")
elif u1 == 'paper':
if u2 == 'rock':
return("Paper wins!")
else:
return("Scissors win!")
else:
return("Invalid input! You have not entered rock, paper or scissors, try again.")
sys.exit()

print(compare(user1_answer, user2_answer))
11. from datetime import datetime
name=input("Enter you name:\t")
age=int(input("Enter age:\t"))
fyear=int((100-age) + datetime.now().year)
print(fyear)
print ('Hello %s. You are %s years old. You will turn 100 years old in %s.' %(name,age,fyear))

Вам также может понравиться

  • Python
    Python
    Документ51 страница
    Python
    bhartiya_amit52
    Оценок пока нет
  • Python Example Programs
    Python Example Programs
    Документ5 страниц
    Python Example Programs
    esmani84
    100% (1)
  • Soil Mech
    Soil Mech
    Документ154 страницы
    Soil Mech
    Papitha
    Оценок пока нет
  • Let's Play with Excel
    Let's Play with Excel
    От Everand
    Let's Play with Excel
    Оценок пока нет
  • Python Lab
    Python Lab
    Документ24 страницы
    Python Lab
    Dr. R. Mariappan
    Оценок пока нет
  • Tut5 Solution
    Tut5 Solution
    Документ13 страниц
    Tut5 Solution
    ritz0874
    Оценок пока нет
  • Python
    Python
    Документ9 страниц
    Python
    Clarence Nolasco
    Оценок пока нет
  • Python
    Python
    Документ9 страниц
    Python
    Clarence Nolasco
    Оценок пока нет
  • Python 123455
    Python 123455
    Документ11 страниц
    Python 123455
    Aayush Singh
    Оценок пока нет
  • Sample Python
    Sample Python
    Документ4 страницы
    Sample Python
    radhika.cta
    Оценок пока нет
  • Python Handson
    Python Handson
    Документ4 страницы
    Python Handson
    ANWESHA DUTT
    100% (1)
  • 12 Python Corrected PRG
    12 Python Corrected PRG
    Документ4 страницы
    12 Python Corrected PRG
    Akshaya Mohan
    Оценок пока нет
  • Airlines
    Airlines
    Документ9 страниц
    Airlines
    Lakwin Bensic
    Оценок пока нет
  • 100 Python Examples.
    100 Python Examples.
    Документ44 страницы
    100 Python Examples.
    abhimanyu thakur
    Оценок пока нет
  • Calculator
    Calculator
    Документ1 страница
    Calculator
    rudravermaz259
    Оценок пока нет
  • Python
    Python
    Документ5 страниц
    Python
    preyaratiffau-7614
    Оценок пока нет
  • Input and Output
    Input and Output
    Документ28 страниц
    Input and Output
    justchilltanuj
    Оценок пока нет
  • Airlines MYPROJECT PYTHON ADITYA RANJAN PDF
    Airlines MYPROJECT PYTHON ADITYA RANJAN PDF
    Документ12 страниц
    Airlines MYPROJECT PYTHON ADITYA RANJAN PDF
    Raj
    Оценок пока нет
  • IT1002 22bsmi01
    IT1002 22bsmi01
    Документ24 страницы
    IT1002 22bsmi01
    Anwarul Islam Utso
    Оценок пока нет
  • Project (ARCADE GAME)
    Project (ARCADE GAME)
    Документ11 страниц
    Project (ARCADE GAME)
    Roshkrishna Ranjith
    Оценок пока нет
  • Latihan Python
    Latihan Python
    Документ4 страницы
    Latihan Python
    rozita
    100% (1)
  • CS Practical File 3
    CS Practical File 3
    Документ18 страниц
    CS Practical File 3
    om
    Оценок пока нет
  • CS Practical File 2
    CS Practical File 2
    Документ9 страниц
    CS Practical File 2
    om
    Оценок пока нет
  • FOC Lab Output4
    FOC Lab Output4
    Документ7 страниц
    FOC Lab Output4
    Joezerk Carpio
    Оценок пока нет
  • Print: # Write Your Code Here
    Print: # Write Your Code Here
    Документ16 страниц
    Print: # Write Your Code Here
    LAHDISSOU HICHAM
    Оценок пока нет
  • Lab Python Programs
    Lab Python Programs
    Документ12 страниц
    Lab Python Programs
    srinivasanbalachandran87
    Оценок пока нет
  • Brain Teaser - Group 2
    Brain Teaser - Group 2
    Документ4 страницы
    Brain Teaser - Group 2
    Gamer King
    Оценок пока нет
  • Question Bank
    Question Bank
    Документ22 страницы
    Question Bank
    Almir Hadžović
    Оценок пока нет
  • Biology
    Biology
    Документ10 страниц
    Biology
    rishab ghosh
    Оценок пока нет
  • Pages From Hotel-Management
    Pages From Hotel-Management
    Документ5 страниц
    Pages From Hotel-Management
    Muthumeenatchi U
    Оценок пока нет
  • Python Programs
    Python Programs
    Документ7 страниц
    Python Programs
    Subbu Suni
    Оценок пока нет
  • Number Comversion
    Number Comversion
    Документ9 страниц
    Number Comversion
    Raghu nath
    Оценок пока нет
  • Kanishak Mishra Practical File
    Kanishak Mishra Practical File
    Документ37 страниц
    Kanishak Mishra Practical File
    Ayan Singh
    Оценок пока нет
  • Input Print Print: November 14, 2022
    Input Print Print: November 14, 2022
    Документ7 страниц
    Input Print Print: November 14, 2022
    BM Walter
    Оценок пока нет
  • Python Game Design - Rock Paper Scissors
    Python Game Design - Rock Paper Scissors
    Документ7 страниц
    Python Game Design - Rock Paper Scissors
    MMS Event Planners
    Оценок пока нет
  • Kaun Banega Crorepati
    Kaun Banega Crorepati
    Документ4 страницы
    Kaun Banega Crorepati
    sagaryouyou986
    Оценок пока нет
  • Python Example
    Python Example
    Документ43 страницы
    Python Example
    Sri Ashish
    Оценок пока нет
  • Python Courses
    Python Courses
    Документ6 страниц
    Python Courses
    Sidahmed Medani
    Оценок пока нет
  • Integration Formulas
    Integration Formulas
    Документ40 страниц
    Integration Formulas
    Zoya
    Оценок пока нет
  • My Python Projects
    My Python Projects
    Документ8 страниц
    My Python Projects
    Anmol
    Оценок пока нет
  • Rps
    Rps
    Документ19 страниц
    Rps
    Anonymous 21Z3G6bn
    Оценок пока нет
  • PWP Exp5
    PWP Exp5
    Документ5 страниц
    PWP Exp5
    surajborgave161
    Оценок пока нет
  • Dhruv H 11 A CS
    Dhruv H 11 A CS
    Документ25 страниц
    Dhruv H 11 A CS
    dhruv
    Оценок пока нет
  • Class XI Project
    Class XI Project
    Документ8 страниц
    Class XI Project
    Shubham Das
    Оценок пока нет
  • PDF
    PDF
    Документ13 страниц
    PDF
    sahib.singh.arora69
    Оценок пока нет
  • Ai Practical - Anuj Shukla - 10f - Colaboratory
    Ai Practical - Anuj Shukla - 10f - Colaboratory
    Документ13 страниц
    Ai Practical - Anuj Shukla - 10f - Colaboratory
    Anuj
    Оценок пока нет
  • Sodapdf
    Sodapdf
    Документ4 страницы
    Sodapdf
    Perli Raj Kumar
    Оценок пока нет
  • Class 11 Prac Programs 2022
    Class 11 Prac Programs 2022
    Документ7 страниц
    Class 11 Prac Programs 2022
    Kalyani Sreekumar
    Оценок пока нет
  • c185aca4-12b6-4834-a075-705cb7142840 (1)
    c185aca4-12b6-4834-a075-705cb7142840 (1)
    Документ48 страниц
    c185aca4-12b6-4834-a075-705cb7142840 (1)
    VenuGopala Reddy
    Оценок пока нет
  • Control Structure
    Control Structure
    Документ12 страниц
    Control Structure
    malathi
    Оценок пока нет
  • Py
    Py
    Документ11 страниц
    Py
    ermias
    Оценок пока нет
  • CS PF 12
    CS PF 12
    Документ27 страниц
    CS PF 12
    sakshamandmicku
    Оценок пока нет
  • MATH FUNCTION LIBRARY - Aadya Singh-12-E - Aadya Singh
    MATH FUNCTION LIBRARY - Aadya Singh-12-E - Aadya Singh
    Документ16 страниц
    MATH FUNCTION LIBRARY - Aadya Singh-12-E - Aadya Singh
    Hungry-- Joy
    Оценок пока нет
  • Phytoncodesxx 2
    Phytoncodesxx 2
    Документ12 страниц
    Phytoncodesxx 2
    Jennifer Verona
    Оценок пока нет
  • Module 1 Python Basics - Programs
    Module 1 Python Basics - Programs
    Документ13 страниц
    Module 1 Python Basics - Programs
    Megha Trivedi
    Оценок пока нет
  • Computer Science Practicals
    Computer Science Practicals
    Документ8 страниц
    Computer Science Practicals
    Pritha Khanna
    Оценок пока нет
  • Xii Python Computer Science Practicals English Medium
    Xii Python Computer Science Practicals English Medium
    Документ2 страницы
    Xii Python Computer Science Practicals English Medium
    rsgk
    60% (5)
  • Python Beginner Code
    Python Beginner Code
    Документ11 страниц
    Python Beginner Code
    zayanullah.khan11
    Оценок пока нет
  • Lab Manual For Python
    Lab Manual For Python
    Документ34 страницы
    Lab Manual For Python
    ELAVARASI M
    Оценок пока нет
  • Python File
    Python File
    Документ9 страниц
    Python File
    manishjanwani7
    Оценок пока нет
  • Python For Beginners
    Python For Beginners
    От Everand
    Python For Beginners
    Оценок пока нет
  • Java
    Java
    Документ60 страниц
    Java
    Papitha
    Оценок пока нет
  • Security Services For E-Mail Attacks Possible Through E-Mail Establishing Keys Privacy Authentication of The Source Message Integrity Non-Repudiation
    Security Services For E-Mail Attacks Possible Through E-Mail Establishing Keys Privacy Authentication of The Source Message Integrity Non-Repudiation
    Документ76 страниц
    Security Services For E-Mail Attacks Possible Through E-Mail Establishing Keys Privacy Authentication of The Source Message Integrity Non-Repudiation
    Papitha
    Оценок пока нет
  • Distributed QB
    Distributed QB
    Документ5 страниц
    Distributed QB
    Papitha
    Оценок пока нет
  • Information Retrieval - Question Bank
    Information Retrieval - Question Bank
    Документ3 страницы
    Information Retrieval - Question Bank
    Papitha
    Оценок пока нет
  • CS6701 - CNS - Unit III - Final PDF
    CS6701 - CNS - Unit III - Final PDF
    Документ60 страниц
    CS6701 - CNS - Unit III - Final PDF
    Papitha
    Оценок пока нет
  • Cs6701 - Cns - Unit III - Final
    Cs6701 - Cns - Unit III - Final
    Документ60 страниц
    Cs6701 - Cns - Unit III - Final
    Papitha
    Оценок пока нет
  • Unit I
    Unit I
    Документ24 страницы
    Unit I
    Papitha
    Оценок пока нет
  • CN 1.5
    CN 1.5
    Документ3 страницы
    CN 1.5
    Papitha
    Оценок пока нет
  • CN 1.6
    CN 1.6
    Документ1 страница
    CN 1.6
    Papitha
    Оценок пока нет
  • CS6703 Grid and Cloud Computing: Unit I
    CS6703 Grid and Cloud Computing: Unit I
    Документ29 страниц
    CS6703 Grid and Cloud Computing: Unit I
    Papitha
    Оценок пока нет
  • CS6551 CN Notes
    CS6551 CN Notes
    Документ216 страниц
    CS6551 CN Notes
    Papitha
    Оценок пока нет
  • CS6703 Grid and Cloud Computing Unit II
    CS6703 Grid and Cloud Computing Unit II
    Документ11 страниц
    CS6703 Grid and Cloud Computing Unit II
    Papitha
    Оценок пока нет
  • CN 1.4
    CN 1.4
    Документ2 страницы
    CN 1.4
    Papitha
    Оценок пока нет
  • CN 1.2
    CN 1.2
    Документ5 страниц
    CN 1.2
    Papitha
    Оценок пока нет
  • CN 1.3
    CN 1.3
    Документ4 страницы
    CN 1.3
    Papitha
    Оценок пока нет
  • Unit-Ii Knowledge Representation and Reasoning Part-A
    Unit-Ii Knowledge Representation and Reasoning Part-A
    Документ10 страниц
    Unit-Ii Knowledge Representation and Reasoning Part-A
    Papitha
    Оценок пока нет
  • CN 1.1
    CN 1.1
    Документ2 страницы
    CN 1.1
    Papitha
    Оценок пока нет