Giter Site home page Giter Site logo

task05's Introduction

This IS The solution of the Task No.5

Task 5 -Variables and String

Create a new repo on your GitHub with the name (Task5) and Create a project on your PC and a file task5.py inside. Solve the questions below in task5.py Push your project into your remote repo Put the link of this repo here in classroom task5

Ask the user to input his (name, age, street, city, and country) (related to question 1) Print the output on the console, it should look like this: "Name: Lama" "Age: 20" "Address: 159, Gaza, Palestine"

-Note: Print the double quotes (“) and the Colon (:)

(related to question 1) Print the next output with dynamic data: "Hello {Lama} Your age is 15 Years Old, Your Address is 159, Gaza, Palestine." -hint: (age - 5)

(related to question 1) Print the type of the above 5 variables: <class 'str'> <class 'str'> <class 'str'> <class 'str'> <class 'str'>

(related to question 1) Print the next output with dynamic data:

"Hello Lama, How Are You? \ """ Your Age Is "15"" + And Your Country Is: Palestine

-Note: You Must Print the above string Exactly with all symbols (“ ‘, ? \ “”” + : )

نسخ الكود

Print the same previous output (in question 5 ) but with a multi-line string. "Hello 'Lama', How Are You?
""" Your Age Is "15"" + And Your City Is: Gaza Create a variable( name = 'ITF Gsg Python') and print the next output:

First Letter Is "I" Third Letter Is "F" Last Letter Is "n" نسخ الكود-hint: use indexing.

(related to question 7) Print the next output:

hon ITF IFGg nohtyP نسخ الكود-hint: use slicing.

Remove the symbols (before and after) the name: name = "$&$&Mohammed$&$&"

Output should be:

Mohammed

Create a variable with the next value, Replace all matches of the symbol (%7) with the (Love) word.

msg = "I %7 Python And Although I %7 GSG with Zakaria"

############Needed To be Output

I Love Python And Although I Love GSG with Zakaria

Create 6 variables with the next values, and print the next output:

num1 = "4" num2 = "56" num3 = "963" num4 = "385" num5 = "8719" num6 = "87190"

Needed To be Output

00004 00056 00963 00385 87190 What is the difference between (title) and (capitalize) methods in Python string methods? (give me 2 examples to clarify the point)

Create a variable with your name value, and print the next output:

first_name = "Dana"

Needed To be Output

***Dana ***Dana*** Dana***

Create 2 variables with the next values, and print the next output: name_one = "SaMER" name_two = "Abed"

Needed To be Output

sAmer aBED samer ABED

(related to question 14) How can we Check if name_one contains Only Upper Case letters, and name_two contains Only Lower Case letters?

Bonus (+2 Marks) (related to question 14) How can we Check if name_one starts with (S) letters or Not ? and name_two ends with (HD) letters or Not? Create a variable with the next value, and print how many times (Love) word and the letter (t) within the string: msg = "I Love Python And Although I Love GSG with Zakaria"

Needed To be Output

Number of is: 2 Number of is:3

Create a variable with the next value, and replace Only the first match of the symbol (%7) with the (Love) word: msg = "I %7 Python And Although I %7 GSG with Zakaria"

Needed To be Output

I Love Python And Although I %7 GSG with Zakaria

Given a string. check if the string is symmetrical and palindrome or not. A string is said to be symmetrical if both the halves of the string are the same and a string is said to be a palindrome string if one half of the string is the reverse of the other half or if a string appears the same when read forward or backward. Hint: Ignore the spaces, dots, or commas in the string. test1 = "ZakZak" test2 = "Zakaria" test3 = "A war at Tarawa." test4 = "madam"

Needed To be Output

ZakZak is symmetrical, but ZakZak is NOT a palindrome. ################################ Zakaria is NOT symmetrical, and Zakaria is NOT a palindrome. ################################

task05's People

Contributors

aljazzarr 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.