Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 1 : Loops and Conditional Statements Try to work out what value of x the following code returns ( initially without running it )

Problem 1: Loops and Conditional Statements
Try to work out what value of x the following code returns (initially without running it). Draw a data flow
chart (like the ones used in class) explaining the code.
import numpy as np
import sympy
x=-1
if np*tan(73****x4)0 :
x=2
else:
x=np*
if np.floor (x)==x :
x=10
else:
x=7
if sympy.isprime(x) :
x= True
else:
x=False
print (x)
Is this result true for any value of x we start with? You can find out about the command isprime by
typing help (sympy.isprime) after importing sympy.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning C# 2005 Databases

Authors: Karli Watson

1st Edition

0470044063, 978-0470044063

More Books

Students also viewed these Databases questions

Question

=+ Have they changed the way employers view IP?

Answered: 1 week ago