Question

Subject: Management information technology (python) Write a program (script mode) that first sets x to a...

Subject: Management information technology (python)

Write a program (script mode) that first sets x to a string with the character 2, y to the value 3, and z to the value 23.3.

Using the type function, the program must display the type of each of the following expressions:

x

y

z

y+z

0 0
Add a comment Improve this question Transcribed image text
Answer #1

#Management Information Technology(Python)
#setting x as string with value of character 2
x = "2"
#setting y with value of 2
y = 3
#setting z with value of 23.3
z = 23.3

#printing type of x,y,z,(y+z)
print(type(x))
print(type(y))
print(type(z))
print(type(y+z))

Please note that I have saved the file as "program.py" in my documents folder.

executing the same in Python IDLE by Clicking "Run" menu then Run Module option.or simply press F5.


Add a comment
Know the answer?
Add Answer to:
Subject: Management information technology (python) Write a program (script mode) that first sets x to a...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Python)) Data types of Python. Write the python script to show the different examples. Write the...

    Python)) Data types of Python. Write the python script to show the different examples. Write the Python script to present ALL the mathematical arithmetic operations. Write the Python script to display your - first name, last name, ID, college name and the program of study. Write the Python script to receive the number of seconds as input and display the hours, minutes and seconds as output. Assume the variable x to be with the string of "Day by day, dear...

  • python Programming Exercise 4.7 Write a script that decrypts a message coded by the method used...

    python Programming Exercise 4.7 Write a script that decrypts a message coded by the method used in Project 6. Method used in project 6: Add 1 to each character’s numeric ASCII value. Convert it to a bit string. Shift the bits of this string one place to the left. A single-space character in the encrypted string separates the resulting bit strings. An example of the program input and output is shown below: Enter the coded text: 0010011 1001101 1011011 1011011...

  • Program must be in Python 3. Write a program that prompts the user to enter two...

    Program must be in Python 3. Write a program that prompts the user to enter two strings and then displays a message indicating whether or not the first string starts with the second string. Your program must satisfy the following requirements. 1. Your program must include a function called myStartsWith that takes two string parameters. This function returns True if the rst string starts with the second string and returns False otherwise. 2. Your program must include a main function...

  • Write program and programmer information as comments at the top of the script. Create a text...

    Write program and programmer information as comments at the top of the script. Create a text file called words.txt and include at least 20 English dictionary-based words in your folder. Program must read the list of words from the file into list data structure. Program chooses a random word from the list and starts asking player to guess the word one character at a time until player wins or runs out of predefined no. of tries. Game continues until the...

  • USE Python 1. Assign value 555 to the variable x, write code to square the variable...

    USE Python 1. Assign value 555 to the variable x, write code to square the variable x and print out the result. 2. Given a string x, write a program to check if its first character is the same as its last character. If yes, the code should output "True" . 3. We defined two variables, x = 'Python' and y = '3.0'. Write code to concatenate the two numbers (the result should be 'Python3.0').

  • PYTHON 1- Write a function that receives a string value as a parameter, converts its first...

    PYTHON 1- Write a function that receives a string value as a parameter, converts its first character to uppercase and returns the first character. 2- Test your function by writing a main, which calls your function and prints its return value. 3- Save your program in a file called firstChar.py and use the following link to submit your file.  

  • . Use what you learned from our First Python Program to write a Python program that...

    . Use what you learned from our First Python Program to write a Python program that will carry out the following tasks. Ask user provide the following information: unit price (for example: 2.5) quantity (for example: 4) Use the following formula to calculate the revenue: revenue = unit price x quantity Print the result in the following format on the console: The revenue is $___. (for example: The revenue is $10.0.) . . Use the following formula to calculate the...

  • 1. Write a python script that will compute and display information for a company which rents...

    1. Write a python script that will compute and display information for a company which rents vehicles to its customers. For a specified customer, the program will compute and display the amount of money charged for that customer’s vehicle rental after prompting the user to enter the following four items for a given customer (in the specified order)  The car type (a character either C (compact), M (mid-size), L (luxury), S (SUV), or V (Van) )  The number...

  • Write a python program that contains a hardcoded string and checks whether it is a palindrome...

    Write a python program that contains a hardcoded string and checks whether it is a palindrome (the same forwards as backwards). If it is then display “It is a palindrome”, otherwise display “It is not a palindrome”. A hardcoded string is simply a string defined in your program, for example: my_string = “Hello” Some sample palindromes to use are: A car, a man, a maraca Desserts, I stressed Madam, I’m Adam You will need to strip out any punctuation such...

  • this is for script for terminal or putty question 1------ 1. Write a PERL script/program based...

    this is for script for terminal or putty question 1------ 1. Write a PERL script/program based on the following requirements. The program should to prompt the user for how many courses the plan to take next semester and ask the user to enter each of those courses before displaying all the information entered back on the screen. question 2------ 2. Write a PERL script that defines/declares an array or a list of elements. The array should hold three-letter abbreviations for...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT